---
title: |
  Replication material: Schulte-Cloos and Anghel (2023) 'Right-wing authoritarian attitudes, fast-paced decision-making, and the spread of misinformation about COVID-19 vaccines', doi: 10.1080/10584609.2023.2291538.
author: |
  Julia Schulte-Cloos
date: '05 December 2023'
format:
  html:
    theme: flatly
    standalone: true
    highlight: textmate
    code-fold: true
    code-summary: "Show the code"
    toc: true
    number_sections: yes
    toc_depth: 2 
link-citations: true
execute: 
  message: false
  warning: false
---

```{r}
#| label: setup


pacman::p_load(
  tictoc,
  tidyverse,
  tidymodels,
  ggupset,
  knitr,
  kableExtra,
  here,
  RColorBrewer,
  tictoc,
  broom,
  jcolors,
  rcartocolor,
  colorspace,
  Hmisc,
  lubridate,
  modelsummary,
  janitor,
  magick,
  gt,
  patchwork, 
  showtext, 
  sysfonts, 
  glue, 
  ggtext, 
  fixest, 
  purrr, 
  rsample, 
  khroma
)



# seed as specified in the PAP
set.seed(853147)


# include computationally intense bootstrap estimation?
bootstrap_estimation <- FALSE

```



```{r set-ggplot-font-html}

## add a font from google fonts
font_add_google(
  name = "Fira Sans",
  family = "Fira Sans"
)

ggplot_font <- "Fira Sans"
```


```{r theme-set-ggplot}

ggplot2::theme_set(
  theme_bw(base_size = 16) +
    theme(text = element_text(family = ggplot_font)) +
    theme(
      plot.title = element_text(
        hjust = 0.5
        ),
      plot.subtitle = element_text(
        size = rel(0.8), 
        hjust = 0.5
        ), 
      legend.title = element_text(
        size = rel(0.8)
        ),
      plot.caption = element_text(hjust = 0, 
                              size = rel(0.7))
      ))


showtext::showtext_auto()
```


# Data Import and Operationalization 

## Survey experimental data

We import the (raw) survey experimental data. 

```{r load-raw-data}

covid_misinfo_data <- read_csv("data/raw/covid_misinfo.csv")

covid_misinfo_news_data <- read_csv("data/raw/covid_misinfo_news.csv")

covid_misinfo_data <- covid_misinfo_data %>% 
  left_join(., 
            covid_misinfo_news_data %>% 
              group_by(ID) %>% 
              select(accuracy_nudge, fastpaced_nudge) %>% 
              slice(1), 
            by = c("ID"))

```


## Aggregate statistical data

We also add data on the official numbers of COVID-19 infections during our field work (weekly data obtained by the ECDC).

```{r add-ecdc-covid-infections-data}

covid_misinfo_data <- covid_misinfo_data %>%
  left_join(.,
    read_csv("./data/raw/covid_incidence_ecdc_data.csv") %>%
      mutate(nuts2_code = str_sub(nuts_code, start = 1, end = 4)) %>%
      group_by(nuts2_code, year_week) %>%
      summarise(rate_14_day_per_100k = mean(
        rate_14_day_per_100k,
        na.rm = T
      )) %>%
      rename(response_week_incidence = rate_14_day_per_100k),
    by = c(
      "region_nuts" = "nuts2_code",
      "survey_year_week" = "year_week"
    )
  )
```


## Recoding of covariates

We recode some of the variables. 

```{r recode-covariates-respondent-level-data}

covid_misinfo_data <-
  covid_misinfo_data %>%
  mutate(
    gender = case_when(
      gender == 1 ~ 1,
      gender == 2 ~ 0,
      gender == 3 ~ NA_real_
    ),
    age = as.numeric(2021 - year_born),
    diaspora = case_when(
      diaspora == 1 ~ 0,
      diaspora == 2 ~ 1,
      diaspora == 3 ~ NA_real_
    ),
    minority = case_when(
      minority == 1 ~ 1,
      minority == 2 ~ 0,
      minority == 3 ~ NA_real_
    ),
    religion_life = case_when(
      religion_1 == 1 ~ 1,
      religion_1 == 2 ~ 0,
      religion_1 == 3 ~ NA_real_
    ),
    religious_service = case_when(
      religion_2 == 6 ~ NA_real_,
      TRUE ~ as.numeric(religion_2)
    ),
    covid_infection = case_when(
      covid_infection == 1 ~ 1,
      covid_infection == 2 ~ 0
    ),
    covid_vaccination = case_when(
      covid_vaccination == 1 ~ 1,
      covid_vaccination == 2 ~ 0
    )
  ) %>%
  rename(female = gender)  %>%
  mutate(
    # indicator variables
    university_education = if_else(education_level >= 4, 1, 0),
    religious = if_else(religion_life == 1 | religious_service >= 4, 1, 0),
    rural = if_else(urban_rural >= 3, 1, 0),
    above_50 = if_else(age >= 50, 1, 0)) %>% 
  group_by(country) %>% 
  # standardised continuous variables
  mutate(
    political_news_std = as.numeric(scale(political_news)),
    response_week_incidence_std = as.numeric(scale(response_week_incidence)),
    support_government_std = as.numeric(scale(support_government))
  )



```


## Outcome Variables: News Sharing and News Discernment


```{r join-respondent-level-average-news-sharing}

covid_misinfo_data <- covid_misinfo_data %>%
  left_join(.,
    covid_misinfo_news_data %>%
      group_by(ID, fake_news) %>%
      mutate(fake_news = if_else(fake_news == 1, "fake", "true")) %>%
      summarise(mean = mean(news_sharing)) %>%
      pivot_wider(
        id_cols = "ID",
        names_from = "fake_news",
        values_from = "mean",
        names_prefix = "mean_"
      ),
    by = c("ID")
  ) %>%
  mutate(news_distinguish = mean_true - mean_fake)
```


## Distribution of outcome variables (Figure B1)

The central outcome of interest in our online experiment is respondents' intention to share fake news headlines. In our analyses, we rely on two central outcome variables. First, we rely on 'news-sharing', which is measured at the news item level and records respondents' answers to the question 'Would you consider sharing this news item when encountered online?'. Respondents indicate their likelihood to share a given news item along a scale ranging from one to four ['extremely unlikely', 'unlikely', 'likely', to 'extremely likely']. Second, we rely on 'discernment', which is measured at the respondent-level and estimated as the difference in respondents' average likelihood to disseminate true headlines and their average likelihood to disseminate false headlines. @fig-distribution-plot shows the raw distribution of these two outcome variables. The upper panel of the figure shows the distribution of news-sharing (by false and true news items), while the lower panel of the figure shows respondents' discernment. As can be seen from @fig-distribution-plot, respondents in both Hungary and Romania indicate that they would be 'extremely unlikely' to share false news items more frequently than they indicate the same for true news items. 


```{r distribution-plot}
#| fig.height: 5
#| fig-cap: "Distribution of news-sharing (by false and true news items) and respondents' average discernment. Unstandardised raw outcome variables."
#| label: fig-distribution-plot

distribution_plot <- bind_rows(
  covid_misinfo_news_data %>%
    group_by(country, fake_news) %>%
    mutate(outcome = "news_sharing") %>%
    mutate(data_type = if_else(fake_news == 1, 
                               "Fake News",
                               "True News"
    )),
  covid_misinfo_data %>%
    group_by(country) %>% 
    mutate(outcome = "news_distinguish") %>%
    mutate(data_type = "")
) %>%
  mutate(outcome_variable = if_else(outcome == "news_sharing", 
                                    news_sharing,
                                    news_distinguish
  )) %>%
  arrange(country, desc(outcome)) %>% 
  group_by(country, outcome) %>%
  nest() %>%
  mutate(plot = map2(
    data,
    country, 
    ~ ggplot() +
      labs(
        x = "",
        y = "",
        title = if_else(outcome == "news_sharing",
                        paste0(.y, "\nNews Item Level: Sharing"),
                        paste0(.y, "\nRespondent Level: Discernment")
        )
      ) +
      geom_histogram(
        data = .,
        aes(x = outcome_variable),
        alpha = 0.2,
        bins = 25, 
        color = jcolors::jcolors(palette = "pal12")[3]
      ) +
      scale_y_continuous(n.breaks = 5) + 
      facet_wrap(~data_type) 
  ))



distribution_outcomes <- distribution_plot$plot[[1]] + distribution_plot$plot[[3]] + 
distribution_plot$plot[[2]] + distribution_plot$plot[[4]] + plot_layout(nrow = 2, 
                                                                        ncol = 2)


distribution_outcomes


```


## Right-wing authoritarian attitudes: Dimensionality reduction

We first subset the data to include only the relevant outcome variables, the observational covariates, the treatment condition, and the relevant identifiers. We then perform the dimensionality reduction of the different right-wing authoritarian measures (by country). We reduce the items into a single index by performing a Principal Component Analysis (PCA) and by averaging across all items (Means).

```{r outcome-covariates-subset-data}

authoritarian_variables <- covid_misinfo_data %>%
  ungroup() %>% 
  select(starts_with("rwa_") |
    starts_with("outgroup_") |
    starts_with("nationalism_")) %>%
  colnames()


experimental_variables <- c("accuracy_nudge", 
                            "fastpaced_nudge")


observational_variables <- c(
  "covid_vaccination",
  "religious",
  "rural",
  "political_news_std",
  "university_education",
  "above_50",
  "support_government_std",
  "diaspora",
  "female",
  "covid_infection",
  "response_week_incidence_std"
)


outcome_variables <- c(
  "news_sharing",
  "mean_fake",
  "mean_true",
  "news_distinguish",
  "response_time"
)

covid_misinfo_data <- covid_misinfo_data %>%
  ungroup() %>%
  select(
    "ID",
    "country",
    "country_id",
    "region_nuts",
    "survey_year_week", 
    any_of(observational_variables),
    any_of(authoritarian_variables),
    any_of(experimental_variables), 
    any_of(outcome_variables), 
    "manipulation_check"
  )

rm(authoritarian_variables)

```


Next, we nest the data by the different authoritarian dimensions.

```{r nested-by-authoritarian-dimensions}

covid_dimensions <- covid_misinfo_data %>%
  ungroup() %>%
  select(
    country, ID,
    matches("rwa_"),
    matches("outgroup_"),
    matches("nationalism_")
  ) %>%
  pivot_longer(starts_with(c(
    "rwa_", "outgroup_",
    "nationalism_"
  )),
  names_to = "authoritarian_variable",
  values_to = "value"
  ) %>%
  mutate(authoritarian_measure = case_when(
    str_detect(authoritarian_variable, "rwa_") ~ "rwa",
    str_detect(authoritarian_variable, "outgroup_") ~ "outgroup",
    str_detect(authoritarian_variable, "nationalism_") ~ "nationalism"
  )) %>%
  group_by(country, authoritarian_measure) %>%
  nest() %>%
  # bring back to wide format for the dimensionality reduction
  mutate(data = map(
    data,
    ~ pivot_wider(.,
      id_cols = "ID",
      names_from = "authoritarian_variable",
      values_from = "value"
    )
  )) %>%
  # calculate mean of each authoritarian group
  mutate(mean_group = map(
    data,
    ~ .x %>%
      select(-ID) %>%
      rowMeans()
  ))
```


### PCA (Figure A1)

We perform PCA on each of the dimensions. 

```{r pca-dimensionality-reduction}

covid_pca <- covid_dimensions %>%
  # define recipe, identifier ID, normalise, and apply PCA
  mutate(
    pca_rec = map(
      data,
      ~ recipe(~.,
        data = .x
      ) %>%
        update_role(ID, new_role = "id") %>%
        step_normalize(all_predictors()) %>%
        step_pca(all_predictors(),
          options = c(
            center = TRUE,
            scale. = TRUE
          )
        )
    ),
    # preprocess pca
    pca_prep = map(
      pca_rec,
      ~ prep(.)
    ),
    # add pca to the data
    pca_bake = map2(
      pca_prep,
      data,
      ~ bake(.x,
        new_data = .y
      )
    ), 
    prcomp = map(
      pca_prep,
      # get pr comp object
      ~ pluck(., "steps") %>%
        .[[2]] %>%
        pluck("res")
      )
  )


# direction of pca ("the sign of the PCA is arbitrary", see prcomp doc)
covid_pca <- covid_pca %>%
  mutate(pca_1 = map(
    pca_bake,
    ~ pull(., PC1)
  )) %>%
  mutate(transformation = map2(
    pca_1,
    mean_group,
    ~ ifelse(
      cor(.x, .y, method = c("pearson")) < 0,
      TRUE,
      FALSE
    )
  )) %>%
  mutate(pca_first = case_when(
    transformation == TRUE ~ map(pca_1, ~ .x * (-1)),
    transformation == FALSE ~ pca_1
  )) %>%
  mutate(correlation = map2(
    pca_first,
    mean_group,
    ~ cor(.x, .y, method = c("pearson"))
  ))


# create pca_wide dataset
pca_first_wide <- covid_pca %>%
  # add the ID value
  mutate(data = map(
    data,
    ~ select(., ID)
  )) %>%
  select(authoritarian_measure, pca_first, data) %>%
  unnest(pca_first, data) %>%
  pivot_wider(
    id_cols = c("ID"),
    names_from = "authoritarian_measure",
    names_prefix = "pca_",
    values_from = "pca_first"
  )


# add pca to the data
covid_misinfo_data <- covid_misinfo_data %>%
  left_join(
    .,
    pca_first_wide
  ) %>%
  group_by(country) %>%
  mutate(across(starts_with("pca_"), ~ as.numeric(scale(.x))))
```


Figure  show the contributions of each variable to the principal component. This contribution is a scaled version of the squared correlation between variables and component axes used to assess the representation of the variables of the principal component, and it is computed as cos(variable,axis)2×100 / total cos2 of the component.


```{r pca-plot}
#| out-width: 100%
#| fig-cap: "Contributions of the different question items to the first principal components."
#| label: fig-pca-plot
#| fig-height: 6

covid_pca_contributions <- covid_pca %>% 
  select(country, prcomp) %>% 
  mutate(contribution = map(.x = prcomp, 
                            .f = ~ abs(.x$rotation) %>% 
                              sweep(., 2, colSums(.), "/") %>% 
                              as_tibble(rownames = "variable"))
         ) %>% 
  select(-prcomp) %>% 
  unnest(cols = c("contribution")) %>% 
  pivot_longer(cols = matches("PC"), 
               values_to = "contribution", 
               names_to = "PC", 
               names_prefix = "PC") %>%
  mutate(PC = as.numeric(PC)) %>% 
  # join percent of variance explained from the eigenvalues matrix
  left_join(., 
            covid_pca %>%
              select(country, prcomp) %>%
              mutate(tidy_eigenvalues = map(
                prcomp,
                ~ tidy(.,
                  matrix = "eigenvalues"
                )
              )) %>%
              select(-prcomp) %>%
              unnest(cols = c("tidy_eigenvalues")), 
            by = c("country", "authoritarian_measure", "PC")
  )



covid_pca_contributions_plot <- covid_pca_contributions %>%
  filter(PC == 1) %>% 
  mutate(country_dimension = paste0(country, ": ", authoritarian_measure)) %>% 
  arrange(desc(authoritarian_measure), country) %>% 
  mutate(PC_explained = paste0("PC", PC, ": ", 
                               round(100*percent, digits = 0), "%")) %>%
  mutate(authoritarian_measure = case_when(
    authoritarian_measure == "rwa" ~ "Authoritarianism (VSA)", 
    authoritarian_measure == "outgroup" ~ "Outgroup Hostility", 
    authoritarian_measure == "nationalism" ~ "Nationalism"
  )) %>% 
  mutate(variable = case_when(
    str_starts(variable, pattern = "rwa_") ~ str_replace(variable, pattern = "rwa", 
                                                         replacement = "vsa"), 
    TRUE ~ variable
  )) %>% 
  group_by(authoritarian_measure) %>% 
  nest() %>% 
  mutate(colorscheme = case_when(
     authoritarian_measure == "Authoritarianism (VSA)" ~ list(carto_pal(n = 6, name = "TealGrn")), 
     authoritarian_measure == "Outgroup Hostility" ~ list(carto_pal(n = 5, name = "Teal")), 
     authoritarian_measure == "Nationalism" ~ list(carto_pal(n = 3, name = "Emrld"))
     )) %>%   
  mutate(plot = pmap(list(..1 = data,
                          ..2 = authoritarian_measure, 
                          ..3 = colorscheme), 
                    ~ ggplot(data = ..1, 
                             aes(x = contribution, 
                                 y = fct_rev(variable), 
                                 color = fct_rev(variable))) +
                      geom_segment(
                        aes(
                          yend = fct_rev(variable), 
                          color = fct_rev(variable)),
                        xend = 0, 
                        #colour = "grey50", 
                        size = 1.5) +  
                      geom_point(size=4) +
                      geom_text(
                        aes(label = paste0(round(contribution*100, digits=0), "%")),
                        color = "black",
                        family = "Linux Libertine", 
                        nudge_x = 0.04) +
                      scale_x_continuous(limits = c(0, NA), 
                                         breaks = NULL) +
                      facet_grid(cols = vars(country)) +
                      scale_color_manual(values = ..3, 
                                         guide = "none") +
                      labs(y = NULL, 
                           x = NULL, 
                           title = ..2) + 
                      theme(
                          plot.title = element_text(
                            hjust = -0.11
                          ),
                          plot.subtitle = element_text(
                            size = rel(0.8),
                            hjust = 0
                          )) + 
                      theme(plot.margin = unit(c(1,0,0,0), "cm"))
  ))


# show the value of the eigenvector (axis score) on the indicated principal component.
pca_plot <- covid_pca_contributions_plot$plot[[1]] + covid_pca_contributions_plot$plot[[2]] +  covid_pca_contributions_plot$plot[[3]] + plot_layout(
  nrow = 3, 
  heights = c(1, 0.8333, 0.6), guides = "collect") 

pca_plot
```


We also obtain the first factor of the PCA of all items belonging to any of the relevant dimensions of interest.

```{r overall-pca}

covid_overall_pca <- covid_misinfo_data %>%
  ungroup() %>%
  select(
    country, ID,
    matches("rwa_"),
    matches("outgroup_"),
    matches("nationalism_")
  ) %>%
  group_by(country) %>%
  nest() %>%
  # calculate mean 
  mutate(mean_group = map(
    data,
    ~ .x %>%
      select(-ID) %>%
      rowMeans()
  ))



covid_overall_pca <- covid_overall_pca %>%
  # define recipe, identifier ID, normalise, and apply PCA
  mutate(
    pca_rec = map(
      data,
      ~ recipe(~.,
        data = .x
      ) %>%
        update_role(ID, new_role = "id") %>%
        step_normalize(all_predictors()) %>%
        step_pca(all_predictors(),
          options = c(
            center = TRUE,
            scale. = TRUE
          )
        )
    ),
    # preprocess pca
    pca_prep = map(
      pca_rec,
      ~ prep(.)
    ),
    # add pca to the data
    pca_bake = map2(
      pca_prep,
      data,
      ~ bake(.x,
        new_data = .y
      )
    ), 
    prcomp = map(
      pca_prep,
      # get pr comp object
      ~ pluck(., "steps") %>%
        .[[2]] %>%
        pluck("res")
      )
  )



# direction of pca
covid_overall_pca <- covid_overall_pca %>%
  mutate(pca_1 = map(
    pca_bake,
    ~ pull(., PC1)
  )) %>%
  mutate(transformation = map2(
    pca_1,
    mean_group,
    ~ ifelse(
      cor(.x, .y, method = c("pearson")) < 0,
      TRUE,
      FALSE
    )
  )) %>%
  mutate(pca_first = case_when(
    transformation == TRUE ~ map(pca_1, ~ .x * (-1)),
    transformation == FALSE ~ pca_1
  )) %>%
  mutate(correlation = map2(
    pca_first,
    mean_group,
    ~ cor(.x, .y, method = c("pearson"))
  ))


# create pca_wide dataset
pca_overall_first_wide <- covid_overall_pca %>%
  # add the ID value
  mutate(data = map(
    data,
    ~ select(., ID)
  )) %>%
  select(pca_first, data) %>%
  unnest(pca_first, data) %>% 
  rename(pca_overall = pca_first)


# add overall pca to the data
covid_misinfo_data <- covid_misinfo_data %>%
  left_join(
    .,
    pca_overall_first_wide
  ) %>%
  group_by(country) %>%
  mutate(across(c("pca_overall"), 
                ~ as.numeric(scale(.x))))

```


### Classification as authoritarian (Figure A2)

We classify respondents as 'high' and 'moderate' in right-wing authoritarian attitudes by comparing their attitudes on each conceptual dimension to the attitudes of all other respondents of the same country. Respondents who rank one standard deviation above the mean (i.e., those respondents who belong to the one third of respondents with the most pronounced right-wing authoritarian attitudes) are classified as 'high', while all others are classified as 'moderate'. @fig-upset-plot shows the intersections of the six different categories (2 levels (high vs. moderate) x 3 dimensions (authoritarianism, outgroup hostility, nationalism)) among respondents in Hungary and Romania. As can be seen from @fig-upset-plot, only a tiny fraction of respondents (2.2% in Hungary and 1.2% in Romania) *consistently* ranks 'high' across all three dimensions - instead, the large majority of respondents (64.9% in Hungary and 61.0% in Romania) consistently rank as moderate across all three dimensions. For our main analyses, we develop a binary measure--'right-wing authoritarian'--that takes the value one for all respondents who rank one standard deviation above the mean in at least one of the three dimensions. According to this classification, 39% of respondents in Romania and 35.1% of respondents in Hungary are considered to hold higher right-wing authoritarian predispositions.


```{r classification-authoritarian}

cutoff_authoritarianism <- covid_misinfo_data %>%
  select(
    c(
      "pca_rwa", "pca_outgroup", "pca_nationalism",
      "country", "ID"
    )
  ) %>%
  pivot_longer(-c(country, ID),
    names_to = "variable",
    values_to = "value"
  ) %>%
  # more than a standard deviation above the mean(0), i.e. greater than 1
  # classified as authoritarian
  mutate(classified_cutoff = if_else(value >= 1, 1, 0)) %>%
  # create authoritarian measure variable
  mutate(authoritarian_measure = case_when(
    str_detect(variable, "rwa") ~ "rwa",
    str_detect(variable, "outgroup") ~ "outgroup",
    str_detect(variable, "nationalism") ~ "nationalism"
  )) %>%
  mutate(dimensionality_reduction = case_when(
    str_detect(variable, "pca") ~ "pca"
    ))


```


```{r construct-high-authoritarian-indicator}

## composite r-w authoritarian indicator: all those are r-w authoritarian who belong to the 33% of the respondents with higher rwa/outgroup/nationalist attitudes

covid_authoritarian_classification <- cutoff_authoritarianism %>%
  select(matches("classified"), 
         country, ID, 
         authoritarian_measure, variable) %>%
  mutate(type = str_remove_all(
    variable, pattern = "_rwa|_outgroup|_nationalism")) %>% 
  # wide format 2 countries x 3 dimensions
  pivot_wider(id_cols = c("country", "ID", "authoritarian_measure"), 
              values_from = classified_cutoff, 
              names_from = type, 
              names_prefix = "authoritarian_") %>%
  group_by(ID, country) %>% 
  # if on any of the three dimensions ranked as "high", i.e. belong to the 33%, classified as r-w authoritarian 
  summarise(across(starts_with("authoritarian_"), 
                   ~max(.))
            ) 


covid_misinfo_data <- covid_misinfo_data %>%
  left_join(
    .,
    covid_authoritarian_classification)


```


```{r upset-plot}
#| out-width: "100%"
#| label: fig-upset-plot
#| fig-cap: "Intersection of respondents' classification as `high' vs. `moderate' regarding their level of right-wing authoritarianism, outgroup hostility, and nationalism. Respondents who rank one standard deviation above the mean are classified as 'high', all others as 'moderate'."

upset_caption <- stringr::str_wrap("Respondents who rank high, i.e., a standard deviation above the mean, in any of the three conceptual dimensions are classified as having higher right-wing authoritarian predispositions.", width = 160)


upset_authoritarianism <- cutoff_authoritarianism %>%
  # pre-process the strings for plotting
  mutate(authoritarian_measure = if_else(
    authoritarian_measure == "rwa", "RWA",
    str_to_title(authoritarian_measure)
  )) %>%
  mutate(classification = ifelse(
    classified_cutoff == 1,
    paste0(authoritarian_measure, ": high"),
    paste0(authoritarian_measure, ": moderate")
  )) %>%
  ungroup() %>%
  select(ID, country, classification) %>%
  group_by(ID, country) %>%
  # create list variable that record each respondents' classification as high/moderate in the three dimensions
  summarise(classification = list(classification))


classification_upset_plot <- upset_authoritarianism %>%
  group_by(country) %>%
  nest() %>%
  # add a subtitle that shows the overall share of respondents classified as authoritarian according to our classification
  left_join(.,
    # calculate overall share of respondents classified as authoritarian
    covid_misinfo_data %>%
      group_by(country) %>%
      select(authoritarian_pca) %>%
      pivot_longer(
        cols = c("authoritarian_pca"),
        names_to = "dimensionality_reduction",
        names_prefix = "authoritarian_",
        values_to = "value"
      ) %>%
      mutate(value = as.numeric(as.character(value))) %>% 
      group_by(country) %>%
      summarise(authoritarian_share = 100 * mean(value)),
    by = c("country")
  ) %>%
  mutate(upset_plot = pmap(
    list(
      data,
      country,
      authoritarian_share
    ),
    ~ ggplot(
      data = ..1,
      aes(x = classification)
    ) +
      geom_bar() +
      # add the percentage of respondents belonging to each intersection
      geom_text(
        stat = "count",
        aes(label = after_stat(round(100 * count / sum(count), digits = 1))),
        vjust = -1, 
        family = "Linux Libertine"
      ) +
      scale_x_upset(
        n_intersections = 20,
        name = ""
      ) +
      scale_y_continuous(
        breaks = NULL, lim = c(0, 1200),
        name = ""
      ) +
      # add title to the plot consisting of country name, and percentage share of respondents in total classified as authoritarian
      labs(
        title = paste0(..2),
        subtitle = paste0("High on at least one dimension: ",
                          round(..3, digits = 1), "%")
      )
  ))

combined_upset <- (classification_upset_plot$upset_plot[[1]] + classification_upset_plot$upset_plot[[2]]) +
  plot_annotation(caption = upset_caption)


combined_upset 

```



# Descriptive Statistics (Tables A1-A6)

All fully specified models reported in the main body of the article and in the supplementary material include a set of covariates which have been operationalised as follows. 

- `above_50`: binary variable that takes the value 1 for all respondents over 50 years of age
- `covid_infection`: binary variable that takes the value 1 for all respondents who report to have been personally infected with COVID-19
- `covid_vaccination`: binary variable that takes the value 1 for all respondents who report to have been vaccinated against COVID-19
- `diaspora`: binary variable that takes the value 1 for respondents who have not been living in the country for the past two years
- `female`: binary variable that takes the value 1 for female respondents
- `political_news_std`: standardised variable that records the amount of time respondents usually spend on watching, reading or listening to news about politics and current affairs
- `religious`: binary variable that takes the value 1 for respondents who consider religion an important part of their lives or who attend religious service at least once a week
- `response_week_incidence_std`: standardised variable that records the COVID-19 incidence rate in respondents' region in the week of their survey participation
- `rural`: binary variable that takes the value 1 for respondents who live in a small town, in a country village, or home in the countryside
- `support_government_std`: standardised variable that records respondents' satisfaction with the way the government is doing its job
- `university_education`: binary variable that takes the value 1 for respondents who have completed education at the university level.

@tbl-descriptive shows descriptive statistics of these variables.

```{r}
#| tbl-cap: "Summary statistics"
#| label: tbl-descriptive

minmax <- function(x) {
  (
    paste0(
      "[",
      round(min(x, na.rm = TRUE), digits = 2),
      ", ",
      round(max(x, na.rm = TRUE), digits = 2),
      "]"
    )
  )
}


fnlist <- function(x) {
  (
    list(x)
  )
}


summary_stats <- covid_misinfo_data %>%
  ungroup() %>% 
  select(
    `Above 50` = above_50,
    `Covid Infection` = covid_infection,
    `Covid Vaccination` = covid_vaccination,
    `Diaspora` = diaspora,
    `Female` = female,
    `Pol. News (Std.)` = political_news_std,
    `Religious` = religious,
    `Incidence Rate (Std.)` = response_week_incidence_std,
    `Rural` = rural,
    `Sup. Gov. (Std.)` = support_government_std,
    `Univ. Education` = university_education
  ) %>%
  mutate(across(.cols = everything(), 
                .f = ~ as.numeric(as.character(.)))) %>% 
  drop_na() %>%
  summarise(across(everything(),
    list(
      N = length,
      mean = mean,
      sd = sd,
      minmax = minmax,
      list = fnlist
    ),
    .names = "{.col}_{.fn}"
  )) %>%
  pivot_longer(
    cols = everything(), 
    names_to = c("Variable", ".value"),
    names_sep = "_"
  ) %>%
  ungroup()



kable(summary_stats %>%
  select(-matches("list")) %>%
  ungroup() %>%
  # create empty columns for the plots
  mutate(
    `hist` = " ",
    `box` = " "
  ),
digits = 2,
col.names = c(
  "",
  "N", "Mean", "SD", "[Min, Max]", " ", " "
),
escape = FALSE
) %>%
  # add the histogram and the boxplots to the table (empty columns needed)
  column_spec(6, image = spec_hist(summary_stats$`list`,
    same_lim = FALSE,
    width = 100
  )) %>%
  column_spec(7, image = spec_boxplot(summary_stats$`list`,
    same_lim = FALSE,
    width = 100,
    medcol = "blue"
  )) %>%
  kableExtra::kable_styling(
    bootstrap_options = c("striped", "hover"),
    font_size = 9
  ) 

```

@tbl-balance-fastpaced-nudge-table and @tbl-balance-accuracy-nudge-table show descriptive statistics (by the two experimental conditions) of all variables included in the fully specified statistical models.

```{r balance-statistics-fastpaced-accuracy}

minmax <- function(x) {
  (
    paste0(
      "[",
      round(min(x, na.rm = TRUE), digits = 2),
      ", ",
      round(max(x, na.rm = TRUE), digits = 2),
      "]"
    )
  )
}


fnlist <- function(x) {
  (
    list(x)
  )
}


summary_stats_fastpaced <- covid_misinfo_data %>%
  ungroup() %>% 
  select(fastpaced_nudge,
    `Above 50` = above_50,
    `Covid Infection` = covid_infection,
    `Covid Vaccination` = covid_vaccination,
    `Diaspora` = diaspora,
    `Female` = female,
    `Pol. News (Std.)` = political_news_std,
    `Religious` = religious,
    `Incidence Rate (Std.)` = response_week_incidence_std,
    `Rural` = rural,
    `Sup. Gov. (Std.)` = support_government_std,
    `Univ. Education` = university_education
  ) %>%
  mutate(across(.cols = everything(), 
                .f = ~ as.numeric(as.character(.)))) %>% 
  drop_na() %>%
  group_by(fastpaced_nudge) %>%
  summarise(across(everything(),
    list(
      N = length,
      mean = mean,
      sd = sd,
      minmax = minmax,
      list = fnlist
    ),
    .names = "{.col}_{.fn}"
  )) %>%
  pivot_longer(-c("fastpaced_nudge"),
    names_to = c("Variable", ".value"),
    names_sep = "_"
  ) %>%
  pivot_wider(
    id_cols = c(Variable),
    names_from = fastpaced_nudge,
    values_from = c(N, mean, sd, minmax, list)
  ) %>%
  ungroup()



summary_stats_accuracy <- covid_misinfo_data %>%
  ungroup() %>% 
  select(accuracy_nudge,
    `Above 50` = above_50,
    `Covid Infection` = covid_infection,
    `Covid Vaccination` = covid_vaccination,
    `Diaspora` = diaspora,
    `Female` = female,
    `Pol. News (Std.)` = political_news_std,
    `Religious` = religious,
    `Incidence Rate (Std.)` = response_week_incidence_std,
    `Rural` = rural,
    `Sup. Government (Std.)` = support_government_std,
    `University Education` = university_education,
  ) %>%
  mutate(across(.cols = everything(), 
                .f = ~ as.numeric(as.character(.)))) %>% 
  drop_na() %>%
  group_by(accuracy_nudge) %>%
  summarise(across(everything(),
    list(
      N = length,
      mean = mean,
      sd = sd,
      minmax = minmax,
      list = fnlist
    ),
    .names = "{.col}_{.fn}"
  )) %>%
  pivot_longer(-c("accuracy_nudge"),
    names_to = c("Variable", ".value"),
    names_sep = "_"
  ) %>%
  pivot_wider(
    id_cols = c(Variable),
    names_from = accuracy_nudge,
    values_from = c(N, mean, sd, minmax, list)
  ) %>%
  ungroup()

```


```{r balance-fastpaced-nudge-table}
#| tbl-cap: "Summary statistics by fast-paced experimental condition"
#| label: tbl-balance-fastpaced-nudge-table

kable(summary_stats_fastpaced %>%
  select(-matches("list")) %>%
  ungroup() %>%
  # create empty columns for the plots
  mutate(
    `hist_0` = " ",
    `hist_1` = " ",
    `box_0` = " ",
    `box_1` = " "
  ) %>%
  # order the columns correctly
  select(
    c("Variable"),
    matches("_1"),
    matches("_0")
  ),
digits = 2,
col.names = c(
  "",
  "N", "Mean", "SD", "[Min, Max]", " ", " ",
  "N", "Mean", "SD", "[Min, Max]", " ", " "
),
booktabs = TRUE,
format = "html", 
escape = FALSE,
caption = "Summary Statistics by Fast-Paced Experimental Condition"
) %>%
  # add the histogram and the boxplots to the table (empty columns needed)
  column_spec(6, image = spec_hist(summary_stats_fastpaced$`list_1`,
    same_lim = FALSE,
    width = 100
  )) %>%
  column_spec(7, image = spec_boxplot(summary_stats_fastpaced$`list_1`,
    same_lim = FALSE,
    width = 100,
    medcol = "blue"
  )) %>%
  column_spec(11, image = spec_hist(summary_stats_fastpaced$`list_0`,
    same_lim = FALSE,
    width = 100
  )) %>%
  column_spec(12, image = spec_boxplot(summary_stats_fastpaced$`list_0`,
    same_lim = FALSE,
    width = 100,
    medcol = "blue"
  )) %>%
  kableExtra::kable_styling(
    bootstrap_options = c("striped", "hover"),
    font_size = 10) %>%
  # column labels Groups
  add_header_above(c(
    " " = 1,
    "Fast-Paced Decision-Making: 1" = 6,
    "Fast-Paced Decision-Making: 0" = 6
  )) 

```


```{r balance-accuracy-nudge-table}
#| tbl-cap: "Summary statistics by accuracy experimental condition"
#| label: tbl-balance-accuracy-nudge-table

kable(summary_stats_accuracy %>%
  select(-matches("list")) %>%
  ungroup() %>%
  # create empty columns for the plots
  mutate(
    `hist_0` = " ",
    `hist_1` = " ",
    `box_0` = " ",
    `box_1` = " "
  ) %>%
  # order the columns correctly
  select(
    c("Variable"),
    matches("_1"),
    matches("_0")
  ),
digits = 2,
col.names = c(
  "",
  "N", "Mean", "SD", "[Min, Max]", " ", " ",
  "N", "Mean", "SD", "[Min, Max]", " ", " "
),
escape = FALSE,
format = "html", 
caption = "Summary Statistics by Accuracy Experimental Condition"
) %>%
  # add the histogram and the boxplots to the table (empty columns needed)
  column_spec(6, image = spec_hist(summary_stats_accuracy$`list_1`,
    same_lim = FALSE,
    width = 100
  )) %>%
  column_spec(7, image = spec_boxplot(summary_stats_accuracy$`list_1`,
    same_lim = FALSE,
    width = 100,
    medcol = "blue"
  )) %>%
  column_spec(11, image = spec_hist(summary_stats_accuracy$`list_0`,
    same_lim = FALSE,
    width = 100
  )) %>%
  column_spec(12, image = spec_boxplot(summary_stats_accuracy$`list_0`,
    same_lim = FALSE,
    width = 100,
    medcol = "blue"
  )) %>%
  kableExtra::kable_styling(
    bootstrap_options = c("striped", "hover"),
    font_size = 10
  ) %>%
  # column labels Year Groups
  add_header_above(c(
    " " = 1,
    "Accuracy Prompt: 1" = 6,
    "Accuracy Prompt: 0" = 6
  )) 

```


@tbl-correlation-table shows the pearson's correlation coefficients between the different socio-demographic and attitudinal covariates included in the fully specified statistical models. 

```{r correlation-table}
#| tbl-cap: "Correlation table of control variables included in the statistical analyses"
#| label: tbl-correlation-table

datasummary_correlation(
  covid_misinfo_data %>%
    select(any_of(observational_variables), authoritarian_pca) %>%
    rename(RWA = authoritarian_pca) %>%
    mutate(across(.cols = everything(), as.numeric)) %>%
    rename_with(
      .cols = everything(),
      .fn = ~ str_to_title(
        str_replace_all(., "[1_]", " ")
      )
    ) %>%
    # order alphabetically
    select(order(colnames(.))),
  output = "kableExtra",
  method = "pearson",
  fmt = 2
) %>%
  kableExtra::column_spec(1, width = "4cm") %>%
  kableExtra::row_spec(0, angle = 90) %>%
  kableExtra::kable_styling(bootstrap_options = c("hover", "striped"), 
                            font_size = 10)
```


@tbl-vaccination-uptake-stats shows the self-reported vaccination rates in our sample and the official vaccination rates (source: European Centre for Disease Prevention and Control) reported by each country during the fieldwork. As can be seen from @tbl-vaccination-uptake-stats, according to official statistics, at the time of our fieldwork, Romania was averaging around half of Hungary's vaccine intake. On the other hand, Hungary had already surpassed the EU average. 


```{r vaccination-uptake-stats}
#| tbl-cap: "Self-reported vaccination status and vaccine-uptake statistics during fieldwork"
#| label: tbl-vaccination-uptake-stats

covid_misinfo_data <- covid_misinfo_data %>%
  mutate(week = as.numeric(
          str_remove_all(survey_year_week,
            pattern = "2021-"
          )
        )) %>% 
  left_join(.,
    read_csv2("data/raw/vaccination_rates.csv") %>%
      mutate(week = as.numeric(
        str_remove_all(`Reporting week`,
          pattern = "2021-W"
        )
      )) %>%
      # drop observations from 2020
      filter(!is.na(week)) %>% 
      rename(
        rate_Hungary = Hungary,
        rate_Romania = Romania
      ) %>%
      mutate(across(starts_with("rate"), as.numeric)) %>%
      pivot_longer(
        cols = c("rate_Hungary", "rate_Romania"),
        names_to = "country",
        names_prefix = "rate_",
        values_to = "rate"
      ) %>%
      select(country, rate, week),
    by = c(
      "week" = "week",
      "country" = "country"
    )
  ) %>% 
  select(-week)


kable(
  covid_misinfo_data %>%
    mutate(across(
      .cols = c("covid_vaccination"),
      .fn = ~ as.numeric(as.character(.))
    )) %>%
    group_by(country, survey_year_week) %>%
    summarise(
      N_respondents = n(),
      sample_vaccination_rate = 100 * mean(covid_vaccination, na.rm = T),
      population_vaccination_rate = 100 * mean(rate)
    ),
  digits = 2,
  col.names = c(
    "Country", "Calendar Week",
    "N Respondents",
    "% Self-Reported Vaccinated",
    "% Vaccine Uptake (Population Statistic)"
  )
) %>%
  kableExtra::kable_styling(
    bootstrap_options = "basic",
    font_size = 9
  ) %>%
  kableExtra::add_footnote("Source: European Centre for Disease Prevention and Control",
    notation = "none"
  ) %>%
  column_spec(4:5, width = "4cm") 
```


# Data Analysis

```{r factor-variables}


factor_vars <- c(
  "authoritarian_pca",
  "authoritarian_mean", 
  "country",
  "stimulus"
)



covid_misinfo_data <- covid_misinfo_data %>%
  ungroup() %>%
  mutate(across(
    c(
      any_of(factor_vars),
      starts_with("authoritarian"),
      "accuracy_nudge",
      "fastpaced_nudge"
    ),
    ~ as.factor(.)
  )) %>% 
  # identifier for countries to be used in FE regression
  mutate(country_id = as.factor(country_id))
```


```{r regression-variables-predictors}

# named vector of authoritarian specifications
authoritarian_vars <- c(
  authoritarian_pca = "authoritarian_pca",
  pca_rwa = "pca_rwa", 
  pca_outgroup = "pca_outgroup", 
  pca_nationalism = "pca_nationalism", 
  pca_overall = "pca_overall"
)

# named vector of observational vars
observational_vars <- c(
  covid_vaccination = "covid_vaccination",
  authoritarian_pca = "authoritarian_pca",
  religious = "religious",
  rural = "rural",
  political_news_std = "political_news_std",
  university_education = "university_education",
  above_50 = "above_50",
  support_government_std = "support_government_std",
  diaspora = "diaspora",
  female = "female",
  covid_infection = "covid_infection",
  response_week_incidence_std = "response_week_incidence_std"
)


# named vector of control vars in the authoritarian x Fast-Paced interaction 
control_vars <- observational_vars[-c(which(observational_vars %in% c("authoritarian_pca")))]

# named vector of alternative authoritarian vars
alt_authoritarian_vars <- authoritarian_vars[-c(which(authoritarian_vars %in% c("authoritarian_pca")))]


id_vars <- c("ID", "country", "country_id", "region_nuts")

```


```{r join-respondent-level-characteristics-to-news-sharing-data}

covid_misinfo_news_data <- covid_misinfo_news_data %>%
  left_join(.,
    covid_misinfo_data %>%
      select(
        ID,
        any_of(id_vars),
        any_of(observational_vars),
        any_of(authoritarian_vars)
      ),
    by = c("ID", "country")
  ) %>%
  mutate(across(
    c(
      "accuracy_nudge",
      "fastpaced_nudge",
      "stimulus"
    ),
    ~ as.factor(.)
  )) %>%
  # identifier for headlines to be used in FE regression
  mutate(num_stimulus = as.factor(as.numeric(str_extract_all(
    stimulus,
    pattern = "[[:digit:]]+", simplify = T
  )))) 

```


```{r standardize-all-outcome-vars}

outcome_variables <- c(
  "news_sharing",
  "mean_fake",
  "mean_true",
  "news_distinguish",
  "response_time"
)


covid_misinfo_data <- covid_misinfo_data %>%
  group_by(country) %>% 
  mutate(across(.cols = any_of(outcome_variables), ~ as.numeric(scale(.))))

covid_misinfo_news_data <- covid_misinfo_news_data %>%
  group_by(country) %>% 
  mutate(across(.cols = c(any_of(outcome_variables)), ~ as.numeric(scale(.))))
```


## Manipulation check (Figure B5)

The success of our central experimental manipulation - mimicking the dynamic logic of a social media environment in which people scroll through the news feed and see individual posts only fleetingly - should result in response times in the fast-paced experimental condition being shorter on average than the response times of those not assigned to this experimental condition. @fig-manipulation-check shows that there is a clear and statistically significant difference in response times between respondents in the fast-paced condition (median/mean response time: 4.86/6.04 seconds) and those not assigned to the fast-paced experimental condition (median/mean response time: 6.36/8.16 seconds). Importantly, both respondents with higher right-wing authoritarian inclinations (6.17 seconds) and respondents without (5.97 seconds) are equally affected by the fast-paced condition.

```{r response-time-plot}

response_time_plot <- bind_rows(
  covid_misinfo_news_data %>%
    group_by(fastpaced_nudge, accuracy_nudge) %>%
    summarise(avg_response_time = list(enframe(
      Hmisc::smean.cl.normal(response_time,
        conf.int = .95
      )
    ))) %>%
    unnest() %>%
    pivot_wider(
      id_cols = c("fastpaced_nudge", "accuracy_nudge"),
      names_from = name,
      values_from = value
    ),
  covid_misinfo_news_data %>%
    group_by(fastpaced_nudge, accuracy_nudge, authoritarian_pca) %>%
    summarise(avg_response_time = list(enframe(
      Hmisc::smean.cl.normal(response_time,
        conf.int = .95
      )
    ))) %>%
    unnest() %>%
    pivot_wider(
      id_cols = c(
        "fastpaced_nudge", "accuracy_nudge",
        "authoritarian_pca"
      ),
      names_from = name,
      values_from = value
    )
) %>%
  mutate(condition = case_when(
    fastpaced_nudge == 0 & accuracy_nudge == 0 ~ "Control",
    fastpaced_nudge == 1 & accuracy_nudge == 0 ~ "Fast-Paced",
    fastpaced_nudge == 0 & accuracy_nudge == 1 ~ "Accuracy",
    fastpaced_nudge == 1 & accuracy_nudge == 1 ~ "Fast-Paced x Accuracy"
  )) %>% 
  mutate(authoritarian_pca = if_else(is.na(authoritarian_pca),
    "all",
    paste(authoritarian_pca)
  ))


response_time_plot <- response_time_plot %>%
  ggplot(
    .,
    aes(
      y = fct_relevel(
        condition,
        "Control", 
        "Accuracy",
        "Fast-Paced x Accuracy", 
        "Fast-Paced"      
        ), 
      x = Mean,
      xmin = Lower,
      xmax = Upper,
      shape = authoritarian_pca,
      color = condition
    )
  ) +
  geom_pointrange(position = position_dodge(width = 0.5)) +
  xlab("") +
  ylab("") +
  ggtitle("Response Times") +
  jcolors::scale_color_jcolors(
    palette = "pal4",
    guide = "none"
  ) +
  scale_shape_discrete(name = "RWA") +
  theme(legend.position = "bottom",
        legend.text = element_text(size = rel(0.5)), 
        legend.justification = "left")


```


```{r instructional-manipulation-check}

# mean share of people indicating the respective answers
manipulation_check <- covid_misinfo_data %>%
  mutate(condition = case_when(
    fastpaced_nudge == 0 & accuracy_nudge == 0 ~ "Control",
    fastpaced_nudge == 1 & accuracy_nudge == 0 ~ "Fast-Paced",
    fastpaced_nudge == 0 & accuracy_nudge == 1 ~ "Accuracy",
    fastpaced_nudge == 1 & accuracy_nudge == 1 ~ "Fast-Paced x Accuracy"
  )) %>%   
  group_by(
    ID, country, condition,
    fastpaced_nudge, accuracy_nudge
  ) %>%
  mutate(correct = case_when(
    accuracy_nudge == 0 & fastpaced_nudge == 0 & manipulation_check == "3" ~ 1,
    accuracy_nudge == 1 & fastpaced_nudge == 0 & manipulation_check == "1" ~ 1,
    accuracy_nudge == 1 & fastpaced_nudge == 1 & manipulation_check == "1, 2" ~ 1,
    accuracy_nudge == 0 & fastpaced_nudge == 1 & manipulation_check == "2" ~ 1,
    TRUE ~ 0
  )) %>%
  mutate(type = "fully correct")


# look at those who were in the crossed (Accuracy x Fast-Paced separately)
manipulation_check2 <- manipulation_check %>%
  filter(accuracy_nudge == 1 & fastpaced_nudge == 1) %>%
  mutate(correct = case_when(
    manipulation_check == "1" ~ 1,
    manipulation_check == "2" ~ 1,
    TRUE ~ 0
  )) %>%
  mutate(type = "partially correct")


manipulation_plot <- bind_rows(
  manipulation_check,
  manipulation_check2
) %>%
  group_by(condition) %>%
  ggplot(aes(
    x = correct,
    y = fct_relevel(
      condition,
      "Control", 
      "Accuracy",
      "Fast-Paced x Accuracy", 
      "Fast-Paced"      
    ),
    color = type
  )) +
  stat_summary(
    geom = "pointrange",
    fun.data = "mean_cl_boot",
    position = position_dodge(width = 0.5),
    B = 5000
  ) +
  xlab("") +
  ylab("") +
  ggtitle("Manipulation Check") +
  scale_color_discrete_diverging(name = "") +
  theme(legend.position = "bottom", 
        legend.text = element_text(size = rel(0.5)), 
        legend.justification = "left")

```


```{r}
#| fig-cap: "Manipulation check"
#| fig-subcap: 
#|   - "Response times"
#|   - "Instructional manipulation check"
#| layout-ncol: 2
#| fig-height: 8
#| fig-align: "center"
#| label: fig-manipulation-check

response_time_plot

manipulation_plot

```


```{r nest-data-by-data-type-news-sharing}

data_nested <- bind_rows(
  covid_misinfo_news_data %>%
    filter(fake_news == 1) %>%
    mutate(
      data_type = "fake_news_item_level",
      outcome = "news_sharing"
    ),
  covid_misinfo_news_data %>%
    filter(fake_news == 0) %>%
    mutate(
      data_type = "true_news_item_level",
      outcome = "news_sharing"
    )) %>%
  group_by(data_type, outcome) %>%
  nest() %>% 
  bind_rows(., 
  covid_misinfo_data %>%
    mutate(
      data_type = "respondent_level",
      outcome = "news_distinguish"
    ) %>%
  group_by(data_type, outcome) %>%
  nest()
)



## nested by subset of respondents who either received the accuracy nudge or did not
data_accuracy_nested <- bind_rows(
  covid_misinfo_news_data %>%
    filter(fake_news == 1) %>%
    mutate(
      data_type = "fake_news_item_level",
      outcome = "news_sharing"
    ),
  covid_misinfo_news_data %>%
    filter(fake_news == 0) %>%
    mutate(
      data_type = "true_news_item_level",
      outcome = "news_sharing"
    )) %>%
  group_by(data_type, outcome,  accuracy_nudge) %>%
  nest() %>% 
  bind_rows(., 
  covid_misinfo_data %>%
    mutate(
      data_type = "respondent_level",
      outcome = "news_distinguish"
    ) %>%
  group_by(data_type, outcome, accuracy_nudge) %>%
  nest()
)



## nested by subset of respondents who either received the fastpaced nudge or did not
data_fastpaced_nested <- bind_rows(
  covid_misinfo_news_data %>%
    filter(fake_news == 1) %>%
    mutate(
      data_type = "fake_news_item_level",
      outcome = "news_sharing"
    ),
  covid_misinfo_news_data %>%
    filter(fake_news == 0) %>%
    mutate(
      data_type = "true_news_item_level",
      outcome = "news_sharing"
    )) %>%
  group_by(data_type, outcome, fastpaced_nudge) %>%
  nest() %>% 
  bind_rows(., 
  covid_misinfo_data %>%
    mutate(
      data_type = "respondent_level",
      outcome = "news_distinguish"
    ) %>%
  group_by(data_type, outcome, fastpaced_nudge) %>%
  nest()
)



## overall nested by country
data_nested_by_country <- bind_rows(
  covid_misinfo_news_data %>%
    filter(fake_news == 1) %>%
    mutate(
      data_type = "fake_news_item_level",
      outcome = "news_sharing"
    ),
  covid_misinfo_news_data %>%
    filter(fake_news == 0) %>%
    mutate(
      data_type = "true_news_item_level",
      outcome = "news_sharing"
    )) %>%
  group_by(country, data_type, outcome) %>%
  nest() %>% 
  bind_rows(., 
  covid_misinfo_data %>%
    mutate(
      data_type = "respondent_level",
      outcome = "news_distinguish"
    ) %>%
  group_by(country, data_type, outcome) %>%
  nest()
)

## by country: nested by subset of respondents who either received the accuracy nudge or did not
data_accuracy_nested_by_country <- bind_rows(
  covid_misinfo_news_data %>%
    filter(fake_news == 1) %>%
    mutate(
      data_type = "fake_news_item_level",
      outcome = "news_sharing"
    ),
  covid_misinfo_news_data %>%
    filter(fake_news == 0) %>%
    mutate(
      data_type = "true_news_item_level",
      outcome = "news_sharing"
    )) %>%
  group_by(country, data_type, outcome,  accuracy_nudge) %>%
  nest() %>% 
  bind_rows(., 
  covid_misinfo_data %>%
    mutate(
      data_type = "respondent_level",
      outcome = "news_distinguish"
    ) %>%
  group_by(country, data_type, outcome, accuracy_nudge) %>%
  nest()
)


## by country: nested by subset of respondents who either received the fastpaced nudge or did not
data_fastpaced_nested_by_country <- bind_rows(
  covid_misinfo_news_data %>%
    filter(fake_news == 1) %>%
    mutate(
      data_type = "fake_news_item_level",
      outcome = "news_sharing"
    ),
  covid_misinfo_news_data %>%
    filter(fake_news == 0) %>%
    mutate(
      data_type = "true_news_item_level",
      outcome = "news_sharing"
    )) %>%
  group_by(country, data_type, outcome, fastpaced_nudge) %>%
  nest() %>% 
  bind_rows(., 
  covid_misinfo_data %>%
    mutate(
      data_type = "respondent_level",
      outcome = "news_distinguish"
    ) %>%
  group_by(country, data_type, outcome, fastpaced_nudge) %>%
  nest()
)


```



```{r regression-functions}

source("./src/regression_funs.R")

```


```{r nested-regressions-full-data}

setFixest_nthreads(4)

data_nested <- data_nested %>%
  mutate(
    lm_observational_simple = map2(
      outcome,
      data,
      ~ map(
        observational_vars,
        function(observational_vars) {
          fit_lm_observational(
            outcome = .x,
            data = .y,
            model = "simple",
            predictor = paste(observational_vars)
          )
        }
      )
    ),
    lm_observational_full = map2(
      outcome,
      data,
      ~ fit_lm_observational(
        outcome = .x,
        data = .y,
        model = "full"
      )
    ),
    lm_authoritarian_simple = map2(
      outcome, 
      data, 
      ~ map(alt_authoritarian_vars, 
            function(alt_authoritarian_vars) {
              fit_lm_authoritarian(
                outcome = .x,
                data = .y,
                model = "simple", 
                predictor = paste0(alt_authoritarian_vars)) 
                     })),
    lm_authoritarian_full = map2(
      outcome, 
      data, 
      ~ map(alt_authoritarian_vars, 
            function(alt_authoritarian_vars) {
              fit_lm_authoritarian(
                outcome = .x,
                data = .y,
                model = "full", 
                predictor = paste0(alt_authoritarian_vars)) 
                     })) ,
    lm_fastpaced_simple = map2(
      outcome,
      data,
      ~ fit_lm_fastpaced(
        outcome = .x,
        data = .y,
        model = "simple"
      )
    ),
    lm_fastpaced_full = map2(
      outcome,
      data,
      ~ fit_lm_fastpaced(
        outcome = .x,
        data = .y,
        model = "full"
      )
    ),
    lm_fastpaced_authoritarian_simple = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_authoritarian(
            outcome = .x,
            data = .y,
            model = "simple",
            authoritarian_measure = paste(authoritarian_vars)
          )
        }
      )
    ),
    lm_fastpaced_authoritarian_full = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_authoritarian(
            outcome = .x,
            data = .y,
            model = "full",
            authoritarian_measure = paste(authoritarian_vars)
          )
        }
      )
    ),
    lm_accuracy_simple = map2(
      outcome,
      data,
      ~ fit_lm_accuracy(
        outcome = .x,
        data = .y,
        model = "simple"
      )
    ),
    lm_accuracy_full = map2(
      outcome,
      data,
      ~ fit_lm_accuracy(
        outcome = .x,
        data = .y,
        model = "full"
      )
    ),
    lm_accuracy_authoritarian_simple = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "simple",
            authoritarian_measure = paste(authoritarian_vars)
          )
        }
      )
    ),
    lm_accuracy_authoritarian_full = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "full",
            authoritarian_measure = paste(authoritarian_vars)
          )
        }
      )
    ), 
    lm_fastpaced_accuracy_authoritarian_simple = map2(
     outcome, 
     data, 
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "simple",
            authoritarian_measure = paste(authoritarian_vars)
          )
        }
      )
     ), 
    lm_fastpaced_accuracy_authoritarian_full = map2(
     outcome, 
     data, 
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "full",
            authoritarian_measure = paste(authoritarian_vars)
          )
        }
      )
    )
  )


```


```{r nested-regression-by-country-full-data}

data_nested_by_country <- data_nested_by_country %>%
  mutate(
    lm_observational_simple = map2(
      outcome,
      data,
      ~ map(
        observational_vars,
        function(observational_vars) {
          fit_lm_observational(
            outcome = .x,
            data = .y,
            model = "simple",
            by_country = TRUE, 
            predictor = paste(observational_vars)
          )
        }
      )
    ),
    lm_observational_full = map2(
      outcome,
      data,
      ~ fit_lm_observational(
        outcome = .x,
        data = .y,
        model = "full", 
        by_country = TRUE
      )
    ),
    lm_fastpaced_simple = map2(
      outcome,
      data,
      ~ fit_lm_fastpaced(
        outcome = .x,
        data = .y,
        model = "simple", 
        by_country = TRUE
      )
    ),
    lm_fastpaced_full = map2(
      outcome,
      data,
      ~ fit_lm_fastpaced(
        outcome = .x,
        data = .y,
        model = "full", 
        by_country = TRUE
      )
    ),
    lm_fastpaced_authoritarian_simple = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_authoritarian(
            outcome = .x,
            data = .y,
            model = "simple",
            authoritarian_measure = paste(authoritarian_vars), 
            by_country = TRUE
          )
        }
      )
    ),
    lm_fastpaced_authoritarian_full = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_authoritarian(
            outcome = .x,
            data = .y,
            model = "full",
            authoritarian_measure = paste(authoritarian_vars), 
            by_country = TRUE
          )
        }
      )
    ), 
    lm_accuracy_simple = map2(
      outcome,
      data,
      ~ fit_lm_accuracy(
        outcome = .x,
        data = .y,
        model = "simple", 
        by_country = TRUE
      )
    ),
    lm_accuracy_full = map2(
      outcome,
      data,
      ~ fit_lm_accuracy(
        outcome = .x,
        data = .y,
        model = "full", 
        by_country = TRUE
      )
    ), 
    lm_accuracy_authoritarian_simple = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "simple",
            authoritarian_measure = paste(authoritarian_vars), 
            by_country = TRUE
          )
        }
      )
    ),
    lm_accuracy_authoritarian_full = map2(
      outcome,
      data,
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "full",
            authoritarian_measure = paste(authoritarian_vars), 
            by_country = TRUE
          )
        }
      )
    ), 
    lm_fastpaced_accuracy_authoritarian_simple = map2(
     outcome, 
     data, 
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "simple",
            authoritarian_measure = paste(authoritarian_vars), 
            by_country = TRUE
          )
        }
      )
     ), 
    lm_fastpaced_accuracy_authoritarian_full = map2(
     outcome, 
     data, 
      ~ map(
        authoritarian_vars,
        function(authoritarian_vars) {
          fit_lm_fastpaced_accuracy_authoritarian(
            outcome = .x,
            data = .y,
            model = "full",
            authoritarian_measure = paste(authoritarian_vars), 
            by_country = TRUE
          )
        }
      )
    )
  )
```


```{r bootstrap-standard-errors, eval=FALSE}

boot_times <- 5000

tic()
# observational patterns
source(file = "./src/bootstrap_observational.R")
toc()

tic()
# estimate effect of fastpaced intervention (overall; by right-wing authoritarian predispositions; by country overall; by country and right-wing authoritarian predispositions)
source(file = "./src/bootstrap_fastpaced.R")
toc()

tic()
# estimate effect of accuracy intervention (overall; by right-wing authoritarian predispositions; by country overall; by country and right-wing authoritarian predispositions)
source(file = "./src/bootstrap_accuracy.R")
toc()


tic()
# three-way interaction effect
source(file = "./src/bootstrap_fastpaced_accuracy.R")
toc()

```



```{r observational-estimates-prepare-data-plotting}

data_observational <- data_nested %>%
  select(data_type, outcome, matches("observational")) %>%
  pivot_longer(
    cols = matches("observational"),
    names_to = "model_specification",
    names_prefix = "lm_observational_",
    values_to = "lm_model"
  )


observational_coefs_simple <- data_observational %>%
  filter(model_specification == "simple") %>%
  # tidy the model
  mutate(tidy_lm = map_depth(
    .x = lm_model,
    .depth = 2,
    .f = ~ tidy(.x)
  )) %>%
  select(-lm_model) %>%
  # extract names of the model
  mutate(predictor = map(
    tidy_lm,
    names
  )) %>%
  unnest(c(tidy_lm, predictor)) %>%
  unnest(tidy_lm)


observational_coefs_full <- data_observational %>%
  filter(model_specification == "full") %>%
  # tidy the model
  mutate(tidy_lm = map(
    .x = lm_model,
    .f = ~ tidy(.x)
  )) %>%
  select(-lm_model) %>%
  unnest(tidy_lm)


observational_coefs <- bind_rows(
  observational_coefs_simple,
  observational_coefs_full
)

observational_terms <- c(
  "covid_vaccination",
  "authoritarian_pca1",
  "religious",
  "political_news_std",
  "support_government_std",
  "rural",
  "university_education",
  "above_50",
  "diaspora",
  "female",
  "covid_infection",
  "response_week_incidence_std"
)

observational_estimates <- observational_coefs %>%
  filter(term %in% observational_terms) %>%
  select(data_type, outcome, term, estimate, model_specification) %>%
  # add the bootstrapped CIs
  right_join(.,
    read_csv("data/bootstrapped_cis/cis_observational.csv") %>%
      rename(
        conf.low = .lower,
        conf.high = .upper
      ) %>%
      filter(term %in% observational_terms),
    by = c("term", "data_type", "outcome", "model_specification")
  )


## prepare data for plotting
observational_plot_data <- observational_estimates %>%
  mutate(data_type = if_else(
    data_type == "respondent_level",
    "",
    data_type
  )) %>%
  mutate(data_type = str_to_title(
    str_replace_all(
      str_remove_all(data_type, pattern = "item_level"),
      pattern = "_",
      replacement = " "
    )
  )) %>%
  mutate(term = str_to_title(str_replace_all(term, "[_]", " "))) %>%
  mutate(term = str_replace_all(term, pattern = " Std", replacement = "")) %>% 
  mutate(term = str_replace_all(term, pattern = " Pca1", replacement = "")) %>%
  mutate(term = if_else(term == "Authoritarian", "Right-Wing Authoritarian", term)) %>% 
  mutate(model_specification = fct_relevel(
    model_specification,
    "full",
    "simple"
  ))


```


## Correlates of news-sharing and news discernment (Figure 1)

### Figure 1

```{r outcome-plots-caption}

outcome_plots_caption <- str_wrap("Note: Coefficients obtained from linear regressions predicting fake/true news-sharing  (news item level) and news discern- ment (respondent level). Estimates in light shading present coefficients from simple linear regressions with fixed effects, estimates in dark shading present fully specified linear regressions including all other covariates and fixed effects. Models predicting news-sharing include headline- and country-fixed effects, models predicting discernment include country-fixed effects. \n90%, 95%, and 99% confidence intervals obtained from 5000 cluster bootstraps.", 
                                  width = 180)


```


```{r observational-plot}
#| label: fig-observational-plot
#| fig-cap: "Correlates of news-sharing by news type (fake vs. true) and news discernment."
#| fig-height: 7
#| out-width: '100%'
#| fig-pos: 'tb'

scale_alpha_values <- c(
  "full" = 1,
  "simple" = 0.2
)


observational_plot <- observational_plot_data %>%
  left_join(
    .,
    # create color-term mapping
    bind_cols(
      color_term = c(rcartocolor::carto_pal(n = 12, name = "Antique")),
      term = sort(c(unique(observational_plot_data$term)), decreasing = F)
    ) %>%
      as_tibble()
  ) %>% 
  mutate(term = glue("{term} <i style='color:{color_term}'>●</i>")) %>% 
  group_by(outcome) %>%
  nest() %>%
  mutate(plot = map(
    data,
    ~ ggplot(
      data = .,
      aes(
        x = estimate,
        xmin = conf.low,
        xmax = conf.high,
        y = fct_rev(term),
        alpha = model_specification, 
        color = term
      )
    ) +
      # 10% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.1),
        size = 2,
        position = position_dodge(width = 0.6)
      ) +
      # 5% CI
      geom_pointrange(
        data = . %>%
          filter(.alpha == 0.05),
        size = 0.7,
        position = position_dodge(width = 0.6)
      ) +
      # 1% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.01),
        size = 0.5,
        position = position_dodge(width = 0.6)
      ) +
      geom_point(
        colour = "white", size = 0.4,
        position = position_dodge(width = 0.6)
      ) +
      rcartocolor::scale_color_carto_d(
        palette = "Antique",  
        guide = "none") + 
      scale_alpha_manual(
        values = scale_alpha_values,
        guide = "none"
      ) +
      labs(
        x = "",
        y = "",
        title = if_else(outcome == "news_sharing",
          "News Item Level: Sharing",
          "Respondent Level: Discernment"
        )
      ) +
      geom_vline(
        xintercept = 0,
        color = "grey50"
      ) +
      theme(legend.position = "bottom", 
            axis.text.y = element_markdown()) + 
      facet_wrap(~data_type) 
  ))


observational_plot_png <- (observational_plot$plot[[1]] + scale_x_continuous(limits = c(-0.6, 0.6))) / (observational_plot$plot[[2]] + scale_x_continuous(limits = c(-1, 1))) + plot_annotation(caption = outcome_plots_caption) +
  plot_layout(guides = "collect") &
  theme(legend.position = "bottom")


observational_plot_png

```

### Table C1

@tbl-observational-table shows the regression table that informs the visual presentation of the results shown in @fig-observational-plot.


```{r observational-table}
#| tbl-cap: "Correlates of news-sharing by news type (fake vs. true) and of news discernment"
#| label: tbl-observational-table

table_note_observational_model <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country. All models include fixed-effects (FE). Models predicting news-sharing include headline FE and country FE, models predicting discernment include country FE."


lm_observational <- data_nested %>%
  select(data_type, outcome, lm_observational_full)


cis_observational_bootstrapped95_cis <- read_csv("data/bootstrapped_cis/cis_observational.csv") %>%
  filter(ci_level == 95) %>%
  filter(model_specification == "full") %>%
  nest(data = c(-data_type, -outcome, -model_specification)) %>%
  mutate(cis = map(
    data,
    ~ tibble(
      variable = paste0(.x %>% select(term) %>% pull()),
      cis = paste0(
        "[",
        sprintf("%.2f", .x %>% pull(.lower)),
        "; ",
        sprintf("%.2f", .x %>% pull(.upper)),
        "]"
      )
    ) %>% deframe()
  ))




## add to the data
lm_observational <- lm_observational %>%
  left_join(
    .,
    cis_observational_bootstrapped95_cis
  )


# create regression table
cm <- c(
  "female" = "Female (0/1)",
  "rural" = "Rural (0/1)",
  "above_50" = "> 50 Years (0/1)",
  "authoritarian_pca1" = "Right-Wing Authoritarian (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "university_education" = "University Education (0/1)",
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)


# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)



names(lm_observational$lm_observational_full) <-
  case_when(
    lm_observational$outcome == "news_distinguish" ~ "Discernment",
    lm_observational$data_type == "fake_news_item_level" ~ "Fake News",
    lm_observational$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_observational$cis) <-
  case_when(
    lm_observational$outcome == "news_distinguish" ~ "Discernment",
    lm_observational$data_type == "fake_news_item_level" ~ "Fake News",
    lm_observational$data_type == "true_news_item_level" ~ "True News"
  )


# regression table
modelsummary(
  models = lm_observational$lm_observational_full,
  vcov = lm_observational$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1
  )) %>%
  # footnote
  add_footnote(table_note_observational_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped"), 
    position = "center"
  )
```


### Figure C1 and Tables C2-C3

@fig-alt-authoritarian-plot and @tbl-alt-authoritarian-table-1 and @tbl-alt-authoritarian-table-2 show that the results are also robust when relying on a continuous measure of right-wing authoritarian attitudes. This continuous operationalisation of right-wing authoritarian pre-dispositions relies on the first principal component of a PCA (standardised to zero mean and unit variance) obtained from reducing the different question items that tap into the dimensions of authoritarianism, outgroup hostility, and nationalism.


```{r fig-alt-authoritarian}

data_authoritarian <- data_nested %>%
  select(data_type, outcome, matches("lm_authoritarian")) %>%
  pivot_longer(
    cols = matches("authoritarian"),
    names_to = "model_specification",
    names_prefix = "lm_authoritarian_",
    values_to = "lm_model"
  )


authoritarian_coefs <- data_authoritarian %>%
  # tidy the model
  mutate(tidy_lm = map_depth(
    .x = lm_model,
    .depth = 2,
    .f = ~ tidy(.x)
  )) %>%
  select(-lm_model) %>%
  # extract names of the model
  mutate(alt_authoritarian_var = map(
    tidy_lm,
    names
  )) %>%
  unnest(c(tidy_lm, alt_authoritarian_var)) %>%
  unnest(tidy_lm)


authoritarian_estimates <- authoritarian_coefs %>%
  filter(term %in% alt_authoritarian_vars) %>%
  select(data_type, outcome, term, estimate, 
         model_specification, alt_authoritarian_var) %>%
  # add the bootstrapped CIs
  right_join(.,
    read_csv("data/bootstrapped_cis/cis_alt_authoritarian.csv") %>%
      rename(
        conf.low = .lower,
        conf.high = .upper
      ) %>%
      filter(term %in% alt_authoritarian_vars),
    by = c("term", "data_type", "outcome", "model_specification", "alt_authoritarian_var")
  )


## prepare data for plotting
authoritarian_plot_data <- authoritarian_estimates %>%
  mutate(data_type = if_else(
    data_type == "respondent_level",
    "",
    data_type
  )) %>%
  mutate(data_type = str_to_title(
    str_replace_all(
      str_remove_all(data_type, pattern = "item_level"),
      pattern = "_",
      replacement = " "
    )
  )) %>%
  mutate(across(c(term),
    .fns = ~ case_when(
      . == "pca_rwa" ~ "Authoritarianism (VSA)",
      . == "pca_outgroup" ~ "Outgroup Hostility",
      . == "pca_nationalism" ~ "Nationalism",
      . == "pca_overall" ~ "All Items"
    )
  )) %>%
  mutate(model_specification = fct_relevel(
    model_specification,
    "full",
    "simple"
  ))


```


```{r alt-outcome-plots-caption}

outcome_plots_caption <- str_wrap("Note: Coefficients obtained from linear regressions predicting fake/true news-sharing  (news item level) and news discer- nment (respondent level). Estimates in light shading present coefficients from simple linear regressions with fixed effects, estimates in dark shading present fully specified linear regressions including all other covariates shown in Figure 1 and fixed effects. Models predicting news-sharing include headline- and country-fixed effects, models predicting discernment include country-fixed effects. 90%, 95%, and 99% confidence intervals obtained from 5000 cluster bootstraps.", 
                                  width = 180)
```


```{r alt-authoritarian-plots}
#| fig-cap: "Correlates of news-sharing by news type (fake vs. true) and discernment. Operationalisation of right-wing authoritarian predispositions as standardised, continuous variables."
#| out-width: "100%"
#| label: fig-alt-authoritarian-plot

scale_alpha_values <- c(
  "full" = 1,
  "simple" = 0.2
)

authoritarian_plot <- authoritarian_plot_data %>%
  left_join(
    .,
    # create color-term mapping
    bind_cols(
      color_term = c(colour("vik")(4)),
      term = sort(c(unique(authoritarian_plot_data$term)), decreasing = F)
    ) %>%
      as_tibble()
  ) %>%
  mutate(term = paste0(term, " <i style='color:", color_term, "'>#</i>")) %>%
  arrange(term) %>%
  group_by(outcome) %>%
  nest() %>%
  mutate(plot = map(
    data,
    ~ ggplot(
      data = .,
      aes(
        x = estimate,
        xmin = conf.low,
        xmax = conf.high,
        y = term,
        alpha = model_specification, 
        color = term
      )
    ) +
      # 10% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.1),
        size = 2,
        position = position_dodge(width = 0.6)
      ) +
      # 5% CI
      geom_pointrange(
        data = . %>%
          filter(.alpha == 0.05),
        size = 0.7,
        position = position_dodge(width = 0.6)
      ) +
      # 1% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.01),
        size = 0.5,
        position = position_dodge(width = 0.6)
      ) +
      geom_point(
        colour = "white", size = 0.4,
        position = position_dodge(width = 0.6)
      ) +
      khroma::scale_color_vik(discrete = T, 
                              guide = "none") +
      scale_alpha_manual(
        values = scale_alpha_values,
        guide = "none"
      ) +
      labs(
        x = "",
        y = "",
        title = if_else(outcome == "news_sharing",
          "News Item Level: Sharing",
          "Respondent Level: Discernment"
        )
      ) +
      geom_vline(
        xintercept = 0,
        color = "grey50"
      ) +
      theme(legend.position = "bottom", 
            axis.text.y = element_markdown()) + 
      facet_wrap(~data_type) 
  ))


observational_plot_alternative_png <- (authoritarian_plot$plot[[1]] + scale_x_continuous(limits = c(-0.4, 0.4))) / authoritarian_plot$plot[[2]] +
  scale_x_continuous(limits = c(-0.4, 0.4)) +
  plot_annotation(caption = outcome_plots_caption) +
  plot_layout(guides = "collect") &
  theme(legend.position = "bottom")


observational_plot_alternative_png

```


```{r alt-authoritarian-table-1}
#| tbl-cap: "Correlates of news-sharing by news type (fake vs. true) and of news discernment - continuous operationalisations of right-wing authoritarian predispositions (Part I)"
#| label: tbl-alt-authoritarian-table-1

table_note_authoritarian_model <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country. All models include fixed-effects (FE). Models predicting news-sharing include headline FE and country FE, models predicting discernment include country FE."


lm_authoritarian <- data_nested %>%
  select(data_type, outcome, lm_authoritarian_full) %>% 
  # extract names of the model
  mutate(alt_authoritarian_var = map(
    lm_authoritarian_full,
    names
  )) %>%
  unnest(c(lm_authoritarian_full, alt_authoritarian_var)) 

cis_authoritarian_bootstrapped95_cis <- read_csv("data/bootstrapped_cis/cis_alt_authoritarian.csv") %>%
  filter(ci_level == 95) %>%
  filter(model_specification == "full") %>%
  nest(data = c(-data_type, -outcome, -model_specification, -alt_authoritarian_var)) %>%
  mutate(cis = map(
    data,
    ~ tibble(
      variable = paste0(.x %>% select(term) %>% pull()),
      cis = paste0(
        "[",
        sprintf("%.2f", .x %>% pull(.lower)),
        "; ",
        sprintf("%.2f", .x %>% pull(.upper)),
        "]"
      )
    ) %>% deframe()
  ))


## add to the data
lm_authoritarian <- lm_authoritarian %>%
  left_join(
    .,
    cis_authoritarian_bootstrapped95_cis
  ) %>% 
  mutate(across(c(alt_authoritarian_var), 
                .fns = ~ as_factor(
                  case_when(
                    . == "pca_rwa" ~ "Authoritarianism (VSA)",
                    . == "pca_outgroup" ~ "Outgroup Hostility",
                    . == "pca_nationalism" ~ "Nationalism",
                    . == "pca_overall" ~ "All Items")
                  )
                ))




# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "pca_rwa" = "Right-Wing Authoritarian (Std.)",
  "pca_outgroup" = "Right-Wing Authoritarian (Std.)",
  "pca_nationalism" = "Right-Wing Authoritarian (Std.)",
  "pca_overall" = "Right-Wing Authoritarian (Std.)",
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "fastpaced_nudge1" = "Fast-Paced (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)


# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)



names(lm_authoritarian$lm_authoritarian_full) <-
  case_when(
    lm_authoritarian$outcome == "news_distinguish" ~ "Discernment",
    lm_authoritarian$data_type == "fake_news_item_level" ~ "Fake News",
    lm_authoritarian$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_authoritarian$cis) <-
  case_when(
    lm_authoritarian$outcome == "news_distinguish" ~ "Discernment",
    lm_authoritarian$data_type == "fake_news_item_level" ~ "Fake News",
    lm_authoritarian$data_type == "true_news_item_level" ~ "True News"
  )


lm_authoritarian_1 <- lm_authoritarian %>% 
  filter(alt_authoritarian_var != "All Items") %>% 
  arrange(alt_authoritarian_var)

# regression table 1
modelsummary(
  models = lm_authoritarian_1$lm_authoritarian_full,
  vcov = lm_authoritarian_1$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1  
  )) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "Authoritarianism (VSA)" = 3,
    "Outgroup Hostility" = 3, 
    "Nationalism" = 3
  )) %>%
  # footnote
  add_footnote(table_note_authoritarian_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("striped", "hover")
  )



```


```{r alt-authoritarian-table-2}
#| tbl-cap: "Correlates of news-sharing by news type (fake vs. true) and of news discernment - continuous operationalisation of right-wing authoritarian predispositions (Part II)"
#| label: tbl-alt-authoritarian-table-2


lm_authoritarian_2 <- lm_authoritarian %>% 
  filter(alt_authoritarian_var == "All Items") 

# regression table 2
modelsummary(
  models = lm_authoritarian_2$lm_authoritarian_full,
  vcov = lm_authoritarian_2$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1  
  )) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "All Items" = 3 
  )) %>%
  # footnote
  add_footnote(table_note_authoritarian_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("striped", "hover")
  )

```

## Correlates of news-sharing and news discernment by country (Figure C2 and Table C4)

@fig-observational-plot-by-countries shows the socio-demographic and attitudinal correlates of fake and true news-sharing behaviour, and respondents' level of discernment, respectively, separately for Hungary and Romania. @tbl-observational-table-by-countries shows the regression table that informs the visual presentation of the results shown in @fig-observational-plot-by-countries.

```{r estimates-observational-plot-by-country}

data_observational_by_country <- data_nested_by_country %>%
  select(data_type, outcome, matches("observational_full"))


observational_coefs_by_country <- data_observational_by_country %>%
  # tidy the model
  mutate(tidy_lm = map(
    .x = lm_observational_full,
    .f = ~ tidy(.x)
  )) %>%
  select(-lm_observational_full) %>%
  unnest(tidy_lm)



observational_terms <- c(
  "covid_vaccination",
  "authoritarian_pca1",
  "religious",
  "political_news_std",
  "support_government_std",
  "rural",
  "university_education",
  "above_50",
  "diaspora",
  "female",
  "covid_infection",
  "response_week_incidence_std"
)


observational_estimates_by_country <- observational_coefs_by_country %>%
  filter(term %in% observational_terms) %>%
  select(data_type, outcome, term, estimate) %>%
  # add the bootstrapped CIs
  right_join(.,
    read_csv("data/bootstrapped_cis/cis_observational_by_country.csv") %>%
      filter(model_specification == "full") %>% 
      rename(
        conf.low = .lower,
        conf.high = .upper
      ) %>%
      filter(term %in% observational_terms),
    by = c("country", "term", "data_type", "outcome")
  )


## prepare data for plotting
observational_plot_data_by_country <- observational_estimates_by_country %>%
  mutate(data_type = if_else(
    data_type == "respondent_level",
    "",
    data_type
  )) %>%
  mutate(data_type = str_to_title(
    str_replace_all(
      str_remove_all(data_type, pattern = "item_level"),
      pattern = "_",
      replacement = " "
    )
  )) %>%
  mutate(term = str_to_title(str_replace_all(term, "[1_]", " "))) %>%
  mutate(term = str_remove_all(term, "Std")) %>% 
  mutate(term = str_remove_all(term, "Pca")) %>%
  mutate(term = if_else(term == "Authoritarian", "Right-Wing Authoritarian", term))


```

```{r observational-plot-by-country}
#| label: fig-observational-plot-by-countries
#| fig-cap: "Correlates of news-sharing by news type (fake vs. true) and of news discernment by countries."
#| out-width: '100%'
#| fig-pos: 'tb'
#| fig-height: 10

observational_plot_by_country <- observational_plot_data_by_country %>%
  group_by(outcome) %>%
  nest() %>%
  mutate(plot = map(
    data,
    ~ ggplot(
      data = .,
      aes(
        x = estimate,
        xmin = conf.low,
        xmax = conf.high,
        y = fct_rev(term),
        color = country
      )
    ) +
      # 10% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.1),
        size = 2,
        position = position_dodge(width = 0.6)
      ) +
      # 5% CI
      geom_pointrange(
        data = . %>%
          filter(.alpha == 0.05),
        size = 0.7,
        position = position_dodge(width = 0.6)
      ) +
      # 1% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.01),
        size = 0.5,
        position = position_dodge(width = 0.6)
      ) +
      khroma::scale_colour_highcontrast(name = "Country") + 
      labs(
        x = "",
        y = "",
        title = if_else(outcome == "news_sharing",
          "News Item Level: Sharing",
          "Respondent Level: Discernment"
        )
      ) +
      geom_vline(
        xintercept = 0,
        color = "grey50"
      ) +
      theme(legend.position = "bottom") +
      facet_wrap(~data_type) 
  ))


outcome_plots_caption <- str_wrap("Note: Coefficients obtained from fully specified linear regressions including all other covariates shown in Figure 1 predicting fake or true news-sharing (news item level) and news discernment (respondent level). Models predicting news-sharing include headline-fixed effects. \n90%, 95%, and 99% confidence intervals obtained from 5000 cluster bootstraps.", 
                                  width = 180)


observational_plot_by_country_png <- observational_plot_by_country$plot[[1]] / observational_plot_by_country$plot[[2]] +
  plot_annotation(caption = outcome_plots_caption) +
  plot_layout(guides = "collect") &
  theme(legend.position = "bottom")


observational_plot_by_country_png

```


```{r observational-table-by-countries}
#| tbl-cap: "Correlates of news-sharing by news type (fake vs. true) and of news discernment - by country."
#| label: tbl-observational-table-by-countries

table_note_observational_model_by_country <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples. Models predicting news-sharing include headline FE."


lm_observational_by_country <- data_nested_by_country %>%
  select(data_type, outcome, lm_observational_full)


cis_observational_by_country_bootstrapped95_cis <- read_csv("data/bootstrapped_cis/cis_observational_by_country.csv") %>%
  filter(ci_level == 95) %>%
  filter(model_specification == "full") %>%
  nest(data = c(-country, -data_type, -outcome, -model_specification)) %>%
  mutate(cis = map(
    data,
    ~ tibble(
      variable = paste0(.x %>% select(term) %>% pull()),
      cis = paste0(
        "[",
        sprintf("%.2f", .x %>% pull(.lower)),
        "; ",
        sprintf("%.2f", .x %>% pull(.upper)),
        "]"
      )
    ) %>% deframe()
  ))


## add to the data
lm_observational_by_country <- lm_observational_by_country %>%
  left_join(
    .,
    cis_observational_by_country_bootstrapped95_cis
  ) %>% 
  arrange(country)


# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "authoritarian_pca1" = "Right-Wing Authoritarian (0/1)",
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)


# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)



names(lm_observational_by_country$lm_observational_full) <-
  case_when(
    lm_observational_by_country$outcome == "news_distinguish" ~ "Discernment",
    lm_observational_by_country$data_type == "fake_news_item_level" ~ "Fake News",
    lm_observational_by_country$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_observational_by_country$cis) <-
  case_when(
    lm_observational_by_country$outcome == "news_distinguish" ~ "Discernment",
    lm_observational_by_country$data_type == "fake_news_item_level" ~ "Fake News",
    lm_observational_by_country$data_type == "true_news_item_level" ~ "True News"
  )


# regression table
modelsummary(
  models = lm_observational_by_country$lm_observational_full,
  vcov = lm_observational_by_country$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1    
  )) %>%
  # add header for countries
  add_header_above(c(
    " " = 1, 
    "Hungary" = 3, 
    "Romania" = 3)
  ) %>% 
  # footnote
  add_footnote(table_note_observational_model_by_country,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 10,
    bootstrap_options = c("hover", "striped")
  )


```


## Fast-Paced Decision-Making


@fig-fastpaced-plot shows the effect of fast-paced decision-making on respondents' news-sharing and on their ability to distinguish between true and false news headlines related to the COVID-19 vaccines.

### Figure 2

```{r fastpaced-decision-making}

fastpaced_coefs_overall <- data_nested %>%
  select(data_type, outcome, lm_fastpaced_simple, lm_fastpaced_full) %>% 
  pivot_longer(
    cols = matches("fastpaced"),
    names_to = "model_specification",
    names_prefix = "lm_fastpaced_",
    values_to = "lm_model"
  ) %>%
  mutate(effect_type = "overall") %>% 
  # tidy the model
  mutate(lm_model = map(
    .x = lm_model,
    .f = ~ tidy(.x)
  )) %>%
  unnest(lm_model) %>% 
  # drop the conventional statistics from the OLS
  select(-c(p.value, statistic, std.error, starts_with("conf"))) %>%   
  # add the bootstrapped CIs 
  right_join(.,
      read_csv("data/bootstrapped_cis/cis_fastpaced.csv") %>%
        rename(
          conf.low = .lower,
          conf.high = .upper
        )
    )


# estimate the ME of fastpaced x authoritarian
fastpaced_coefs_authoritarian <- data_nested %>% 
  mutate(
    lm_fastpaced_ME_authoritarian_simple = map2(
      outcome, 
      data, 
      ~ fit_lm_fastpaced_authoritarian(
                         outcome = .x, 
                         data = .y,  
                         model = "simple", 
                         tidy = TRUE, 
                         authoritarian_measure = "authoritarian_pca", 
                         me_estimate = TRUE)
          ), 
    lm_fastpaced_ME_authoritarian_full = map2(
      outcome, 
      data, 
      ~ fit_lm_fastpaced_authoritarian(
                         outcome = .x, 
                         data = .y,  
                         model = "full", 
                         tidy = TRUE, 
                         authoritarian_measure = "authoritarian_pca", 
                         me_estimate = TRUE)
          )
    ) %>%
  select(data_type, outcome, 
         lm_fastpaced_ME_authoritarian_simple, 
         lm_fastpaced_ME_authoritarian_full) %>% 
  pivot_longer(
    cols = matches("fastpaced"),
    names_to = "model_specification",
    names_prefix = "lm_fastpaced_ME_authoritarian_",
    values_to = "lm_model"
  ) %>%
  mutate(effect_type = "authoritarian_interact") %>%  
  unnest(lm_model) %>% 
  # drop the conventional statistics from the OLS
  select(-c(p.value, statistic, std.error, starts_with("conf"))) %>% 
  right_join(., 
             # ME of fastpaced for authoritarian predispositions
             read_csv("data/bootstrapped_cis/cis_fastpaced_ME_authoritarian.csv") %>%
               rename(
                 conf.low = .lower,
                 conf.high = .upper
                 ), 
             by = c(
               "term", "data_type", "outcome", "model_specification")
  )


fastpaced_coefs <- bind_rows(
  fastpaced_coefs_overall,
  fastpaced_coefs_authoritarian
)



fastpaced_terms <- c(
  "fastpaced_nudge1",
  "authoritarian_pca0:fastpaced_nudge1",
  "authoritarian_pca1:fastpaced_nudge1"
)



# prepare for the plotting
fastpaced_plot_data <- fastpaced_coefs %>%  
  filter(term %in% fastpaced_terms) %>% 
  # prepare for the col facets in the ggplot, respondent-level does not need subdivision
  mutate(data_type = if_else(
    data_type == "respondent_level", 
    "", 
    data_type)) %>% 
  # prepare for the col facets in the ggplot, contrast between fake and true news
  mutate(data_type = str_to_title(
    str_replace_all(
      str_remove_all(data_type, pattern = "item_level"), 
      pattern = "_", 
      replacement = " ")
    )) %>%
  # shape of ggplot aesthetics, prepare authoritarian indicator
  mutate(authoritarian = str_remove_all(
    str_extract_all(string = term, 
                    pattern = "[0-1]:"), 
    pattern = ":")) %>% 
  # authoritarian indicator should be "all" for overall effect
  mutate(authoritarian = if_else(authoritarian=="character(0)", 
                                 "all", 
                                 authoritarian)) %>% 
  mutate(term = str_to_title(
    str_remove_all(term, pattern = "_[a-zA-Z]+[0-1]"))
    ) %>% 
  # prepare the terms that should become y-axis labels in the coefficient plot
  mutate(across(c(term), 
                .fns = ~ as_factor(
                  case_when(
                  . == "Authoritarian:fastpaced" ~ "**Marginal Effect Fast-Paced**<br>(by right-wing authoritarian attitudes)", 
                  . == "Fastpaced" ~ "**Marginal Effect Fast-Paced**<br>(all respondents)"   
                  ) 
                ))) %>%
  mutate(model_specification = fct_relevel(
    model_specification,
    "full",
    "simple"
  )) 


```

```{r generate-fastpaced-plots}
#| label: fig-fastpaced-plot
#| warning: false
#| message: false
#| fig-cap: "Marginal effect of fast-paced decision-making on news-sharing and discernment."
#| out-width: '100%'
#| fig-pos: 'tb'
#| fig-height: 5


scale_alpha_values <- c(
  "full" = 1,
  "simple" = 0.2
)


fastpaced_plot <- fastpaced_plot_data %>%
  arrange(term, model_specification) %>% 
  group_by(outcome) %>%
  nest() %>%
  mutate(plot = map(
    data,
    ~ ggplot(
      data = .,
      aes(
        x = estimate,
        xmin = conf.low,
        xmax = conf.high,
        y = fct_rev(term),
        color = fct_rev(term),
        alpha = model_specification,
        size = .alpha, 
        shape = authoritarian
      )
    ) + 
      # 10% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.1),
        size = 2,
        position = position_dodge(width = 0.7)
      ) +
      # 5% CI
      geom_pointrange(
        data = . %>%
          filter(.alpha == 0.05),
        size = 0.7,
        position = position_dodge(width = 0.7)
      ) +
      # 1% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.01),
        size = 0.5,
        position = position_dodge(width = 0.7)
      ) +
      geom_point(
        colour = "white", size = 0.4,
        position = position_dodge(width = 0.7)
      ) +
      rcartocolor::scale_color_carto_d(
        palette = "Prism",  
        guide = "none") +       
      scale_alpha_manual(
        values = scale_alpha_values,
        guide = "none"
      ) +
      labs(
        x = "",
        y = "",
        title = if_else(outcome == "news_sharing",
          "News Item Level: Sharing",
          "Respondent Level: Discernment"
        )
      ) + 
      theme(axis.text.y = ggtext::element_markdown()) +      
      geom_vline(
        xintercept = 0,
        color = "grey50"
      ) +
      theme(legend.position = "left") +
      facet_grid(cols = vars(data_type)) +
      scale_shape_discrete(name = "Right-Wing Authoritarian")
  ))




fastpaced_plot_png <- (fastpaced_plot$plot[[1]] + scale_x_continuous(limits = c(-0.6, 0.6))) /
  fastpaced_plot$plot[[2]] +
  scale_x_continuous(limits = c(-1, 1)) +
  plot_annotation(caption = outcome_plots_caption) +
  plot_layout(guides = "collect") &
  theme(
    legend.position = "bottom",
    legend.text = element_text(size = rel(0.8))
  ) 


fastpaced_plot_png

```


### Table C5

@tbl-fastpaced-table shows the regression table that informs the visual presentation of the marginal effect estimates of fast-paced decision-making shown in @fig-fastpaced-plot. In brackets, we report the confidence intervals that include the respective estimates in 95 percent of a cluster bootstrap distribution that we obtain by cluster re-sampling 5000 times from our data and estimating the respective coefficients. 

```{r fastpaced-table}
#| tbl-cap: "Effect of fast-paced decision-making on news-sharing and news discernment"
#| label: tbl-fastpaced-table

table_note_fastpaced_model <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country. All models include fixed-effects (FE). Models predicting news-sharing include headline FE and country FE, models predicting discernment include country FE."

lm_fastpaced <- bind_rows(
  # overall effect
  data_nested %>%
    select(
      data_type, outcome,
      lm_fastpaced_full
    ) %>%
    left_join(
      .,
      read_csv("data/bootstrapped_cis/cis_fastpaced.csv") %>%
        filter(ci_level == 95) %>%
        filter(model_specification == "full") %>%
        nest(data = c(-data_type, -outcome, -model_specification)) %>%
        mutate(cis = map(
          data,
          ~ tibble(
            variable = paste0(.x %>% select(term) %>% pull()),
            cis = paste0(
              "[",
              sprintf("%.2f", .x %>% pull(.lower)),
              "; ",
              sprintf("%.2f", .x %>% pull(.upper)),
              "]"
            )
          ) %>% deframe()
        ))
    ),
  # by right-wing authoritarian predispositions
  data_nested %>%
    select(
      data_type, outcome,
      lm_fastpaced_authoritarian_full
    ) %>%
    # take only the estimate of the pca authoritarian model
    mutate(lm_fastpaced_full = map(
      .x = lm_fastpaced_authoritarian_full,
      .f = ~ .x[[1]]
    )) %>%
    select(-lm_fastpaced_authoritarian_full) %>% 
    left_join(
      .,
      read_csv("data/bootstrapped_cis/cis_fastpaced_authoritarian.csv") %>%
        filter(ci_level == 95) %>%
        # keep just the pca estimates
        filter(authoritarian_specification == "authoritarian_pca") %>%
        filter(model_specification == "full") %>%
        nest(data = c(-data_type, -outcome, -model_specification)) %>%
        mutate(cis = map(
          data,
          ~ tibble(
            variable = paste0(.x %>% select(term) %>% pull()),
            cis = paste0(
              "[",
              sprintf("%.2f", .x %>% pull(.lower)),
              "; ",
              sprintf("%.2f", .x %>% pull(.upper)),
              "]"
            )
          ) %>% deframe()
        ))
    )
)



# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "authoritarian_pca1" = "Right-Wing Authoritarian (0/1)",
  "fastpaced_nudge1" = "Fast-Paced Decision-Making (0/1)",  
  "authoritarian_pca1:fastpaced_nudge1" = "Authoritarian x Fast-Paced", 
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)




# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)


names(lm_fastpaced$lm_fastpaced_full) <-
  case_when(
    lm_fastpaced$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_fastpaced$cis) <-
  case_when(
    lm_fastpaced$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced$data_type == "true_news_item_level" ~ "True News"
  )


# regression table
modelsummary(
  models = lm_fastpaced$lm_fastpaced_full,
  vcov = lm_fastpaced$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1    
  )) %>%
  # column labels upper dimension: overall effect vs. interaction effect
  add_header_above(c(
    " " = 1,
    "Overall Effect" = 3,
    "By Right-Wing Authoritarian" = 3
  )) %>%  
  # footnote
  add_footnote(table_note_fastpaced_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped")
  )
```


### Table 1, Table C6, Table C7

@tbl-main-table-coefficients-authoritarian shows the estimates that we obtain when predicting news-sharing and news discernment by interacting respondents' assignment to the experimental condition of 'fast-paced decision-making' with the first principal component of each dimension, standardised to a country-specific mean of zero and unit variance.
 

```{r main-table-coefficients-authoritarian}
#| tbl-cap: "Interaction effect of fast-paced decision-making and scales obtained through Principal Component Analysis (PCA) measuring authoritarianism, outgroup hostility, and nationalism."
#| label: tbl-main-table-coefficients-authoritarian
#| tbl-pos: 'tb'

interaction_term_vars <- c(
  "pca_outgroup",
  "pca_rwa",
  "pca_nationalism",
  "pca_overall",
  "fastpaced"
)



fastpaced_coefs_cont_authoritarian <- data_nested %>%
  select(data_type, outcome, matches("fastpaced_authoritarian")) %>% 
  pivot_longer(
    cols = matches("fastpaced"),
    names_to = "model_specification",
    names_prefix = "lm_fastpaced_authoritarian_",
    values_to = "lm_model"
  ) %>% 
  # tidy the model
  mutate(lm_model = map_depth(
    .x = lm_model,
    .depth = 2,
    .f = ~ tidy(.x)
  )) %>%
  # extract names of the model
  mutate(authoritarian_specification = map(
    lm_model,
    names
  )) %>%
  unnest(c(lm_model, authoritarian_specification)) %>%
  unnest(lm_model) %>% 
  left_join(
    .,
    read_csv("data/bootstrapped_cis/cis_fastpaced_authoritarian.csv") %>%
      filter(ci_level == 95)
  ) %>%
  filter(model_specification == "full") %>%
  filter(data_type == "fake_news_item_level" | data_type == "respondent_level") %>%
  filter(authoritarian_specification %in% alt_authoritarian_vars) %>%
  filter(str_detect(term,
    pattern = paste(interaction_term_vars, collapse = "|")
  )) %>%
  mutate(across(c(term),
    .fns = ~ str_replace_all(.,
      pattern = paste(alt_authoritarian_vars,
        collapse = "|"
      ),
      replacement = "PCA Scale"
    )
  )) %>%
  mutate(across(c(authoritarian_specification),
    .fns = ~ case_when(
      . == "pca_rwa" ~ "Authoritarianism (VSA)",
      . == "pca_outgroup" ~ "Outgroup Hostility",
      . == "pca_nationalism" ~ "Nationalism",
      . == "pca_overall" ~ "All Items"
    )
  )) %>%
  # prepare the interaction terms
  mutate(term = str_replace_all(term,
    pattern = ":fastpaced_nudge1",
    replacement = " x Fast-Paced"
  ) %>%
    str_replace_all(.,
      pattern = "fastpaced_nudge1",
      replacement = "Fast-Paced"
    )) %>%
  mutate(cis = paste0(
    "[",
    sprintf("%.3f", .lower),
    "; ",
    sprintf("%.3f", .upper),
    "]"
  )) %>%
  mutate(authoritarian_specification = fct_relevel(
    authoritarian_specification,
    levels = c(
      "Authoritarianism (VSA)",
      "Nationalism",
      "Outgroup Hostility",
      "All Items"
    )
  )) %>%
  ungroup() %>%
  select(data_type, authoritarian_specification, term, estimate, cis) %>%
  pivot_wider(
    id_cols = c(authoritarian_specification, term),
    names_from = "data_type",
    values_from = c(estimate, cis)
  ) %>%
  mutate(
    column_fake_news = paste(
      round(estimate_fake_news_item_level,
        digits = 2
      ),
      cis_fake_news_item_level
    ),
    column_discernment = paste(
      round(estimate_respondent_level,
        digits = 2
      ),
      cis_respondent_level
    )
  )

footnote_kable <- str_wrap("Note: Estimates from fully specified models predicting fake news-sharing and discernment. Confidence intervals obtained from 5000 cluster bootstrap resamples.",
  width = 200
)




kable(fastpaced_coefs_cont_authoritarian %>%
  select(term, 
         matches("fake_news_item_level"), 
         matches("respondent_level")),
  digits = 2,
  # format = "latex",
  booktabs = TRUE,
  col.names = NULL,
  ) %>%
  column_spec(1, width = "4cm") %>%
  column_spec(c(2, 4), width = "1cm") %>%
  column_spec(c(3, 4), width = "2cm") %>%
  kableExtra::add_header_above(c(" ", "Fake News-Sharing" = 2, "Discernment" = 2)) %>%
  kable_styling(
    position = "center",
    full_width = FALSE,
    bootstrap_options = c("hover", "striped"),
    font_size = 10
  ) %>%
  pack_rows(index = (table(fastpaced_coefs_cont_authoritarian$authoritarian_specification))) %>%
  footnote(
    general_title = "Note:",
    footnote_as_chunk = TRUE,
    threeparttable = TRUE,
    general = "Estimates from fully specified models predicting fake news-sharing and discernment. Confidence intervals obtained from 5000 cluster bootstrap resamples."
  ) 


```

@tbl-alt-fastpaced-table-1 and @tbl-alt-fastpaced-table-2 show the full regression table related to the tabular presentation of the constitutive and interaction terms shown in @tbl-main-table-coefficients-authoritarian. In brackets, we report the confidence intervals that include the respective estimates in 95 percent of a cluster bootstrap distribution that we obtain by re-sampling 5000 times from our data and estimating the respective coefficients. 


```{r alt-fastpaced-table-1}
#| tbl-cap: "Effect of fast-paced decision-making on news-sharing and news discernment - continuous operationalisations of right-wing authoritarian predispositions (Part I)"
#| label: tbl-alt-fastpaced-table-1

table_note_fastpaced_authoritarian_model <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country. All models include fixed-effects (FE). Models predicting news-sharing include headline FE and country FE, models predicting discernment include country FE."


lm_fastpaced_authoritarian <- data_nested %>%
  select(data_type, outcome, lm_fastpaced_authoritarian_full) %>%
  # extract names of the model
  mutate(alt_authoritarian_var = map(
    lm_fastpaced_authoritarian_full,
    names
  )) %>%
  unnest(c(lm_fastpaced_authoritarian_full, alt_authoritarian_var)) %>%
  filter(alt_authoritarian_var != "authoritarian_pca") %>%
  rename(authoritarian_specification = alt_authoritarian_var) %>% 
  left_join(
    .,
    read_csv("data/bootstrapped_cis/cis_fastpaced_authoritarian.csv") %>%
      filter(ci_level == 95) %>%
      filter(model_specification == "full") %>%
      filter(authoritarian_specification != "authoritarian_pca") %>% 
      nest(data = c(-data_type, -outcome, -model_specification, -authoritarian_specification)) %>%
      mutate(cis = map(
        data,
        ~ tibble(
          variable = paste0(.x %>% select(term) %>% pull()),
          cis = paste0(
            "[",
            sprintf("%.2f", .x %>% pull(.lower)),
            "; ",
            sprintf("%.2f", .x %>% pull(.upper)),
            "]"
          )
        ) %>% deframe()
      ))
  ) %>%
  mutate(across(c(authoritarian_specification),
    .fns = ~ as_factor(
      case_when(
        . == "pca_rwa" ~ "Authoritarianism (VSA)",
        . == "pca_outgroup" ~ "Outgroup Hostility",
        . == "pca_nationalism" ~ "Nationalism",
        . == "pca_overall" ~ "All Items"
      )
    )
  ))



# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "pca_rwa" = "Right-Wing Authoritarian (Std.)",
  "pca_outgroup" = "Right-Wing Authoritarian (Std.)",
  "pca_nationalism" = "Right-Wing Authoritarian (Std.)",
  "pca_overall" = "Right-Wing Authoritarian (Std.)",
  "fastpaced_nudge1" = "Fast-Paced (0/1)",
  "pca_rwa:fastpaced_nudge1" = "RWA x Fast-Paced",
  "pca_outgroup:fastpaced_nudge1" = "RWA x Fast-Paced",
  "pca_nationalism:fastpaced_nudge1" = "RWA x Fast-Paced",
  "pca_overall:fastpaced_nudge1" = "RWA x Fast-Paced",  
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)


# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)



names(lm_fastpaced_authoritarian$lm_fastpaced_authoritarian_full) <-
  case_when(
    lm_fastpaced_authoritarian$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced_authoritarian$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced_authoritarian$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_fastpaced_authoritarian$cis) <-
  case_when(
    lm_fastpaced_authoritarian$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced_authoritarian$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced_authoritarian$data_type == "true_news_item_level" ~ "True News"
  )


lm_fastpaced_authoritarian_1 <- lm_fastpaced_authoritarian %>% 
  filter(authoritarian_specification != "All Items") %>% 
  arrange(authoritarian_specification)

# regression table 1
modelsummary(
  models = lm_fastpaced_authoritarian_1$lm_fastpaced_authoritarian_full,
  vcov = lm_fastpaced_authoritarian_1$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1  
  )) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "Authoritarianism (VSA)" = 3,
    "Outgroup Hostility" = 3, 
    "Nationalism" = 3
  )) %>%
  # footnote
  add_footnote(table_note_fastpaced_authoritarian_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped")
  )

```



```{r alt-fastpaced-table-2}
#| tbl-cap: "Effect of fast-paced decision-making on news-sharing and news discernment - continuous operationalisations of right-wing authoritarian predispositions (Part II)"
#| label: tbl-alt-fastpaced-table-2

lm_fastpaced_authoritarian_2 <- lm_fastpaced_authoritarian %>% 
  filter(authoritarian_specification == "All Items") 

# regression table 2
modelsummary(
  models = lm_fastpaced_authoritarian_2$lm_fastpaced_authoritarian_full,
  vcov = lm_fastpaced_authoritarian_2$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1
  )) %>%
  # column labels upper dimension: all items PCA
  add_header_above(c(
    " " = 1,
    "All Items" = 3 
  )) %>%   
  # footnote
  add_footnote(table_note_fastpaced_authoritarian_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped")
  )

```





## Fast-Paced Decision-Making by Country

### Figure C3

@fig-fastpaced-plot-by-countries shows the effect of fast-paced decision-making on fake news-sharing reported in @fig-fastpaced-plot, separately for both Hungary and Romania.


```{r fastpaced-decision-making-by-country}

fastpaced_coefs_overall_by_country <- data_nested_by_country %>%
  select(data_type, outcome, lm_fastpaced_full) %>% 
  pivot_longer(
    cols = matches("fastpaced"),
    names_to = "model_specification",
    names_prefix = "lm_fastpaced_",
    values_to = "lm_model"
  ) %>%
  mutate(effect_type = "overall") %>% 
  # tidy the model
  mutate(lm_model = map(
    .x = lm_model,
    .f = ~ tidy(.x)
  )) %>%
  unnest(lm_model) %>% 
  # drop the conventional statistics from the OLS
  select(-c(p.value, statistic, std.error, starts_with("conf"))) %>%   
  # add the bootstrapped CIs 
  right_join(.,
      read_csv("data/bootstrapped_cis/cis_fastpaced_by_country.csv") %>%
        filter(model_specification == "full") %>% 
        rename(
          conf.low = .lower,
          conf.high = .upper
        )
    )


# estimate the ME of fastpaced x r-w authoritarian
fastpaced_coefs_authoritarian_by_country <- data_nested_by_country %>% 
  mutate(
    lm_fastpaced_ME_authoritarian_simple = map2(
      outcome, 
      data, 
      ~ fit_lm_fastpaced_authoritarian(
                         outcome = .x, 
                         data = .y,  
                         model = "simple", 
                         tidy = TRUE, 
                         authoritarian_measure = "authoritarian_pca", 
                         by_country = TRUE, 
                         me_estimate = TRUE)
          ), 
    lm_fastpaced_ME_authoritarian_full = map2(
      outcome, 
      data, 
      ~ fit_lm_fastpaced_authoritarian(
                         outcome = .x, 
                         data = .y,  
                         model = "full", 
                         tidy = TRUE, 
                         authoritarian_measure = "authoritarian_pca", 
                         by_country = TRUE, 
                         me_estimate = TRUE)
          )
    ) %>%
  select(data_type, outcome, 
         lm_fastpaced_ME_authoritarian_simple, 
         lm_fastpaced_ME_authoritarian_full) %>% 
  pivot_longer(
    cols = matches("fastpaced"),
    names_to = "model_specification",
    names_prefix = "lm_fastpaced_ME_authoritarian_",
    values_to = "lm_model"
  ) %>%
  mutate(effect_type = "authoritarian_interact") %>%  
  unnest(lm_model) %>% 
  # drop the conventional statistics from the OLS
  select(-c(p.value, statistic, std.error, starts_with("conf"))) %>% 
  right_join(., 
             # ME of fastpaced for r-w authoritarian predispositions
             read_csv(
               "data/bootstrapped_cis/cis_fastpaced_ME_authoritarian_by_country.csv") %>%
               rename(
                 conf.low = .lower,
                 conf.high = .upper
                 )
  )


fastpaced_coefs_by_country <- bind_rows(
  fastpaced_coefs_overall_by_country,
  fastpaced_coefs_authoritarian_by_country
)



# main plot shows the effect of authoritarian_pca

fastpaced_terms <- c(
  "fastpaced_nudge1",
  "authoritarian_pca0:fastpaced_nudge1",
  "authoritarian_pca1:fastpaced_nudge1"
)



# prepare for the plotting
fastpaced_plot_data_by_country <- fastpaced_coefs_by_country %>%  
  filter(term %in% fastpaced_terms) %>% 
  # prepare for the col facets in the ggplot, respondent-level does not need subdivision
  mutate(data_type = if_else(
    data_type == "respondent_level", 
    "", 
    data_type)) %>% 
  # prepare for the col facets in the ggplot, contrast between fake and true news
  mutate(data_type = str_to_title(
    str_replace_all(
      str_remove_all(data_type, pattern = "item_level"), 
      pattern = "_", 
      replacement = " ")
    )) %>%
  # shape of ggplot aesthetics, prepare authoritarian indicator
  mutate(authoritarian = str_remove_all(
    str_extract_all(string = term, 
                    pattern = "[0-1]:"), 
    pattern = ":")) %>% 
  # authoritarian indicator should be "all" for overall effect
  mutate(authoritarian = if_else(authoritarian=="character(0)", 
                                 "all", 
                                 authoritarian)) %>% 
  mutate(term = str_to_title(
    str_remove_all(term, pattern = "_[a-zA-Z]+[0-1]"))
    ) %>% 
  # prepare the terms that should become y-axis labels in the coefficient plot
  mutate(across(c(term), 
                .fns = ~ as_factor(
                  case_when(
                  . == "Authoritarian:fastpaced" ~ "**Marginal Effect Fast-Paced**<br>(by right-wing authoritarian attitudes)", 
                  . == "Fastpaced" ~ "**Marginal Effect Fast-Paced**<br>(all respondents)"   
                  ) 
                ))) %>%
  mutate(model_specification = fct_relevel(
    model_specification,
    "full",
    "simple"
  )) 



```



```{r fastpaced-plot-by-country}
#| label: fig-fastpaced-plot-by-countries
#| fig-cap: "Marginal effect of fast-paced decision-making on news-sharing and discernment by countries."
#| out-width: "100%"
#| fig-height: 7



outcome_plots_caption <- str_wrap("Note: Coefficients obtained from linear regressions predicting fake/true news-sharing  (news item level) and news discer- nment (respondent level). Estimates in light shading present coefficients from simple linear regressions, estimates in dark shading present fully specified linear regressions including all other covariates shown in Figure 1. Models predicting news-sharing include headline-fixed effects. \n90%, 95%, and 99% confidence intervals obtained from 5000 cluster bootstraps.", 
                                  width = 180)


fastpaced_plot_by_country <- fastpaced_plot_data_by_country %>%
  group_by(outcome) %>%
  nest() %>%
  mutate(plot = map(
    data,
    ~ ggplot(
      data = .,
      aes(
        x = estimate,
        xmin = conf.low,
        xmax = conf.high,
        y = fct_rev(term),
        alpha = model_specification, 
        color = country, 
        shape = authoritarian
      )
    ) +
      # 10% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.1),
        size = 2,
        position = position_dodge(width = 0.6)
      ) +
      # 5% CI
      geom_pointrange(
        data = . %>%
          filter(.alpha == 0.05),
        size = 0.7,
        position = position_dodge(width = 0.6)
      ) +
      # 1% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.01),
        size = 0.5,
        position = position_dodge(width = 0.6)
      ) +
      scale_alpha_manual(
        values = scale_alpha_values,
        guide = "none"
      ) + 
      khroma::scale_colour_highcontrast(name = "Country") + 
      labs(
        x = "",
        y = "",
        title = if_else(outcome == "news_sharing",
          "News Item Level: Sharing",
          "Respondent Level: Discernment"
        )
      ) +
      geom_vline(
        xintercept = 0,
        color = "grey50"
      ) +
      theme(legend.position = "bottom") +
      facet_wrap(~data_type) +
      theme(axis.text.y = ggtext::element_markdown()) +      
      scale_shape_discrete(name = "Right-Wing Authoritarian")
  ))

fastpaced_plot_by_country <- (fastpaced_plot_by_country$plot[[1]] + scale_x_continuous(limits = c(-0.6, 0.6))) / (fastpaced_plot_by_country$plot[[2]] +   scale_x_continuous(limits = c(-1, 1))) +

  plot_annotation(caption = outcome_plots_caption) +
  plot_layout(guides = "collect") &
  theme(legend.position = "bottom")


fastpaced_plot_by_country

```

### Table C8

@tbl-fastpaced-table-by-country shows the regression table that informs the visual presentation of the marginal effect estimates of fast-paced decision-making shown in @fig-fastpaced-plot-by-countries. 


```{r fastpaced-table-by-country}
#| tbl-cap: "Overall effect of fast-paced decision-making on news-sharing and news discernment by country"
#| label: tbl-fastpaced-table-by-country

table_note_fastpaced_by_country <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country (outcome: news-sharing). Models predicting news-sharing include headline FE and country FE."



lm_fastpaced_by_country <- data_nested_by_country %>%
  select(
    country, data_type, outcome,
    lm_fastpaced_full
  )

cis_fastpaced_by_country_bootstrapped95_cis <- read_csv("data/bootstrapped_cis/cis_fastpaced_by_country.csv") %>%
  filter(ci_level == 95) %>%
  filter(model_specification == "full") %>%
  nest(data = c(-country, -data_type, -outcome, -model_specification)) %>%
  mutate(cis = map(
    data,
    ~ tibble(
      variable = paste0(.x %>% select(term) %>% pull()),
      cis = paste0(
        "[",
        sprintf("%.2f", .x %>% pull(.lower)),
        "; ",
        sprintf("%.2f", .x %>% pull(.upper)),
        "]"
      )
    ) %>% deframe()
  ))


## add to the data
lm_fastpaced_by_country <- lm_fastpaced_by_country %>%
  left_join(
    .,
    cis_fastpaced_by_country_bootstrapped95_cis
  ) %>% 
  arrange(country)


# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "authoritarian_pca1" = "Right-Wing Authoritarian (0/1)",
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "fastpaced_nudge1" = "Fast-Paced (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)




# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)


names(lm_fastpaced_by_country$lm_fastpaced_full) <-
  case_when(
    lm_fastpaced_by_country$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced_by_country$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced_by_country$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_fastpaced_by_country$cis) <-
  case_when(
    lm_fastpaced_by_country$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced_by_country$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced_by_country$data_type == "true_news_item_level" ~ "True News"
  )


# regression table
modelsummary(
  models = lm_fastpaced_by_country$lm_fastpaced_full,
  vcov = lm_fastpaced_by_country$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1
  )) %>%
  add_header_above(c(
    " " = 1, 
    "Hungary" = 3, 
    "Romania" = 3
  )) %>%
  # footnote
  add_footnote(table_note_fastpaced_by_country,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped")
  )


```

## Accuracy primes

### Figure C4 and Table C9

@fig-accuracy-plot shows the effect of the accuracy prompt experimental intervention. 


```{r accuracy-decision-making}

outcome_plots_caption <- str_wrap("Note: Coefficients obtained from linear regressions predicting fake/true news-sharing  (news item level) and news discern- ment (respondent level). Estimates in light shading present coefficients from simple linear regressions with fixed effects, estimates in dark shading present fully specified linear regressions including all other covariates and fixed effects. Models predicting news-sharing include headline- and country-fixed effects, models predicting discernment include country-fixed effects. \n90%, 95%, and 99% confidence intervals obtained from 5000 cluster bootstraps.", 
                                  width = 180)

accuracy_coefs_overall <- data_nested %>%
  select(data_type, outcome, lm_accuracy_simple, lm_accuracy_full) %>% 
  pivot_longer(
    cols = matches("accuracy"),
    names_to = "model_specification",
    names_prefix = "lm_accuracy_",
    values_to = "lm_model"
  ) %>%
  mutate(effect_type = "overall") %>% 
  # tidy the model
  mutate(lm_model = map(
    .x = lm_model,
    .f = ~ tidy(.x)
  )) %>%
  unnest(lm_model) %>% 
  # drop the conventional statistics from the OLS
  select(-c(p.value, statistic, std.error, starts_with("conf"))) %>%   
  # add the bootstrapped CIs 
  right_join(.,
      read_csv("data/bootstrapped_cis/cis_accuracy.csv") %>%
        rename(
          conf.low = .lower,
          conf.high = .upper
        )
    )


# estimate the ME of accuracy x authoritarian
accuracy_coefs_authoritarian <- data_nested %>% 
  mutate(
    lm_accuracy_ME_authoritarian_simple = map2(
      outcome, 
      data, 
      ~ fit_lm_accuracy_authoritarian(
                         outcome = .x, 
                         data = .y,  
                         model = "simple", 
                         tidy = TRUE, 
                         authoritarian_measure = "authoritarian_pca", 
                         me_estimate = TRUE)
          ), 
    lm_accuracy_ME_authoritarian_full = map2(
      outcome, 
      data, 
      ~ fit_lm_accuracy_authoritarian(
                         outcome = .x, 
                         data = .y,  
                         model = "full", 
                         tidy = TRUE, 
                         authoritarian_measure = "authoritarian_pca", 
                         me_estimate = TRUE)
          )
    ) %>%
  select(data_type, outcome, 
         lm_accuracy_ME_authoritarian_simple, 
         lm_accuracy_ME_authoritarian_full) %>% 
  pivot_longer(
    cols = matches("accuracy"),
    names_to = "model_specification",
    names_prefix = "lm_accuracy_ME_authoritarian_",
    values_to = "lm_model"
  ) %>%
  mutate(effect_type = "authoritarian_interact") %>%  
  unnest(lm_model) %>% 
  # drop the conventional statistics from the OLS
  select(-c(p.value, statistic, std.error, starts_with("conf"))) %>% 
  right_join(., 
             # ME of accuracy for authoritarian predispositions
             read_csv("data/bootstrapped_cis/cis_accuracy_ME_authoritarian.csv") %>%
               rename(
                 conf.low = .lower,
                 conf.high = .upper
                 ), 
             by = c(
               "term", "data_type", "outcome", "model_specification")
  )


accuracy_coefs <- bind_rows(
  accuracy_coefs_overall,
  accuracy_coefs_authoritarian
)



# main plot shows the effect of authoritarian_pca

accuracy_terms <- c(
  "accuracy_nudge1",
  "authoritarian_pca0:accuracy_nudge1",
  "authoritarian_pca1:accuracy_nudge1"
)



# prepare for the plotting
accuracy_plot_data <- accuracy_coefs %>%  
  filter(term %in% accuracy_terms) %>% 
  # prepare for the col facets in the ggplot, respondent-level does not need subdivision
  mutate(data_type = if_else(
    data_type == "respondent_level", 
    "", 
    data_type)) %>% 
  # prepare for the col facets in the ggplot, contrast between fake and true news
  mutate(data_type = str_to_title(
    str_replace_all(
      str_remove_all(data_type, pattern = "item_level"), 
      pattern = "_", 
      replacement = " ")
    )) %>%
  # shape of ggplot aesthetics, prepare authoritarian indicator
  mutate(authoritarian = str_remove_all(
    str_extract_all(string = term, 
                    pattern = "[0-1]:"), 
    pattern = ":")) %>% 
  # authoritarian indicator should be "all" for overall effect
  mutate(authoritarian = if_else(authoritarian=="character(0)", 
                                 "all", 
                                 authoritarian)) %>% 
  mutate(term = str_to_title(
    str_remove_all(term, pattern = "_[a-zA-Z]+[0-1]"))
    ) %>% 
  # prepare the terms that should become y-axis labels in the coefficient plot
  mutate(across(c(term), 
                .fns = ~ as_factor(
                  case_when(
                  . == "Authoritarian:accuracy" ~ "**Marginal Effect Accuracy**<br>(by right-wing authoritarian attitudes)", 
                  . == "Accuracy" ~ "**Marginal Effect Accuracy**<br>(all respondents)"   
                  ) 
                ))) %>%
  mutate(model_specification = fct_relevel(
    model_specification,
    "full",
    "simple"
  )) 


```

```{r generate-accuracy-plots}
#| label: fig-accuracy-plot
#| fig-cap: "Marginal effect of accuracy prime on news-sharing and discernment."
#| out-width: "100%"

scale_alpha_values <- c(
  "full" = 1,
  "simple" = 0.2
)


accuracy_plot <- accuracy_plot_data %>%
  arrange(term, model_specification) %>% 
  group_by(outcome) %>%
  nest() %>%
  mutate(plot = map(
    data,
    ~ ggplot(
      data = .,
      aes(
        x = estimate,
        xmin = conf.low,
        xmax = conf.high,
        y = fct_rev(term),
        color = fct_rev(term),
        alpha = model_specification,
        size = .alpha, 
        shape = authoritarian
      )
    ) + 
      # 10% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.1),
        size = 2,
        position = position_dodge(width = 0.7)
      ) +
      # 5% CI
      geom_pointrange(
        data = . %>%
          filter(.alpha == 0.05),
        size = 0.7,
        position = position_dodge(width = 0.7)
      ) +
      # 1% CI
      geom_linerange(
        data = . %>%
          filter(.alpha == 0.01),
        size = 0.5,
        position = position_dodge(width = 0.7)
      ) +
      geom_point(
        colour = "white", size = 0.4,
        position = position_dodge(width = 0.7)
      ) +
      rcartocolor::scale_color_carto_d(
        palette = "Prism",  
        guide = "none") +       
      scale_alpha_manual(
        values = scale_alpha_values,
        guide = "none"
      ) +
      labs(
        x = "",
        y = "",
        title = if_else(outcome == "news_sharing",
          "News Item Level: Sharing",
          "Respondent Level: Discernment"
        )
      ) + 
      theme(axis.text.y = ggtext::element_markdown()) +      
      geom_vline(
        xintercept = 0,
        color = "grey50"
      ) +
      theme(legend.position = "left") +
      facet_grid(cols = vars(data_type)) +
      scale_shape_discrete(name = "Right-Wing Authoritarian")
  ))



accuracy_plot_png <- (accuracy_plot$plot[[1]] + scale_x_continuous(limits = c(-0.6, 0.6))) /
  accuracy_plot$plot[[2]] +
  scale_x_continuous(limits = c(-1, 1)) +
  plot_annotation(caption = outcome_plots_caption) +
  plot_layout(guides = "collect") &
  theme(
    legend.position = "bottom",
    legend.text = element_text(size = rel(0.8))
  ) 

accuracy_plot_png

```


@tbl-accuracy-table shows the regression table that informs the visual presentation of the marginal effect estimates of accuracy primes shown in @fig-accuracy-plot.


```{r accuracy-table}
#| tbl-cap: "Effect of accuracy prompt on news-sharing and news discernment"
#| label: tbl-accuracy-table

table_note_accuracy_model <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country. All models include fixed-effects (FE). Models predicting news-sharing include headline FE and country FE, models predicting discernment include country FE."

lm_accuracy <- bind_rows(
  # overall effect
  data_nested %>%
    select(
      data_type, outcome,
      lm_accuracy_full
    ) %>%
    left_join(
      .,
      read_csv("data/bootstrapped_cis/cis_accuracy.csv") %>%
        filter(ci_level == 95) %>%
        filter(model_specification == "full") %>%
        nest(data = c(-data_type, -outcome, -model_specification)) %>%
        mutate(cis = map(
          data,
          ~ tibble(
            variable = paste0(.x %>% select(term) %>% pull()),
            cis = paste0(
              "[",
              sprintf("%.2f", .x %>% pull(.lower)),
              "; ",
              sprintf("%.2f", .x %>% pull(.upper)),
              "]"
            )
          ) %>% deframe()
        ))
    ),
  # by right-wing authoritarian predispositions
  data_nested %>%
    select(
      data_type, outcome,
      lm_accuracy_authoritarian_full
    ) %>%
    # take only the estimate of the pca authoritarian model
    mutate(lm_accuracy_full = map(
      .x = lm_accuracy_authoritarian_full,
      .f = ~ .x[[1]]
    )) %>%
    select(-lm_accuracy_authoritarian_full) %>% 
    left_join(
      .,
      read_csv("data/bootstrapped_cis/cis_accuracy_authoritarian.csv") %>%
        filter(ci_level == 95) %>%
        # keep just the pca estimates
        filter(authoritarian_specification == "authoritarian_pca") %>%
        filter(model_specification == "full") %>%
        nest(data = c(-data_type, -outcome, -model_specification)) %>%
        mutate(cis = map(
          data,
          ~ tibble(
            variable = paste0(.x %>% select(term) %>% pull()),
            cis = paste0(
              "[",
              sprintf("%.2f", .x %>% pull(.lower)),
              "; ",
              sprintf("%.2f", .x %>% pull(.upper)),
              "]"
            )
          ) %>% deframe()
        ))
    )
)



# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "authoritarian_pca1" = "Right-Wing Authoritarian (0/1)",
  "accuracy_nudge1" = "Accuracy Prime (0/1)",  
  "authoritarian_pca1:accuracy_nudge1" = "Authoritarian x Accuracy Prime", 
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)




# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)


names(lm_accuracy$lm_accuracy_full) <-
  case_when(
    lm_accuracy$outcome == "news_distinguish" ~ "Discernment",
    lm_accuracy$data_type == "fake_news_item_level" ~ "Fake News",
    lm_accuracy$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_accuracy$cis) <-
  case_when(
    lm_accuracy$outcome == "news_distinguish" ~ "Discernment",
    lm_accuracy$data_type == "fake_news_item_level" ~ "Fake News",
    lm_accuracy$data_type == "true_news_item_level" ~ "True News"
  )


# regression table
modelsummary(
  models = lm_accuracy$lm_accuracy_full,
  vcov = lm_accuracy$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1    
  )) %>%
  # column labels upper dimension: overall effect vs. interaction effect
  add_header_above(c(
    " " = 1,
    "Overall Effect" = 3,
    "By Right-Wing Authoritarian" = 3
  )) %>%  
  # footnote
  add_footnote(table_note_accuracy_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped")
  )
```



## Accuracy primes by country

### Table C10

@tbl-accuracy-table-by-country shows the marginal effect estimates of accuracy primes separately for Hungary and Romania. 

```{r accuracy-table-by-country}
#| tbl-cap: "Overall effect of fast-paced decision-making on news-sharing and news discernment"
#| label: tbl-accuracy-table-by-country


table_note_accuracy_by_country <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country (outcome: news-sharing). Models predicting news-sharing include headline FE and country FE."

lm_accuracy_by_country <- data_nested_by_country %>%
  select(
    country, data_type, outcome,
    lm_accuracy_full
  )

cis_accuracy_by_country_bootstrapped95_cis <- read_csv("data/bootstrapped_cis/cis_accuracy_by_country.csv") %>%
  filter(ci_level == 95) %>%
  filter(model_specification == "full") %>%
  nest(data = c(-country, -data_type, -outcome, -model_specification)) %>%
  mutate(cis = map(
    data,
    ~ tibble(
      variable = paste0(.x %>% select(term) %>% pull()),
      cis = paste0(
        "[",
        sprintf("%.2f", .x %>% pull(.lower)),
        "; ",
        sprintf("%.2f", .x %>% pull(.upper)),
        "]"
      )
    ) %>% deframe()
  ))


## add to the data
lm_accuracy_by_country <- lm_accuracy_by_country %>%
  left_join(
    .,
    cis_accuracy_by_country_bootstrapped95_cis
  ) %>% 
  arrange(country)


# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "accuracy_nudge1" = "Accuracy Prime (0/1)",
  "authoritarian_pca1" = "Right-Wing Authoritarian (0/1)",
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)




# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)


names(lm_accuracy_by_country$lm_accuracy_full) <-
  case_when(
    lm_accuracy_by_country$outcome == "news_distinguish" ~ "Discernment",
    lm_accuracy_by_country$data_type == "fake_news_item_level" ~ "Fake News",
    lm_accuracy_by_country$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_accuracy_by_country$cis) <-
  case_when(
    lm_accuracy_by_country$outcome == "news_distinguish" ~ "Discernment",
    lm_accuracy_by_country$data_type == "fake_news_item_level" ~ "Fake News",
    lm_accuracy_by_country$data_type == "true_news_item_level" ~ "True News"
  )


# regression table
modelsummary(
  models = lm_accuracy_by_country$lm_accuracy_full,
  vcov = lm_accuracy_by_country$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1, 
    "News Item Level" = 2,
    "Respondent Level" = 1
  )) %>%
  add_header_above(c(
    " " = 1, 
    "Hungary" = 3, 
    "Romania" = 3
  )) %>%
  # footnote
  add_footnote(table_note_accuracy_by_country,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped")
  )


```


## Interaction of fast-paced decision-making and accuracy primes

### Table C11

@tbl-fastpaced-accuracy-authoritarian-table shows the three-way interaction of our to experimental conditions and our binary indicator for higher right-wing authoritarian attitudes.  

```{r fastpaced-accuracy-authoritarian-table}
#| tbl-cap: "Interactive effect of fast-paced decision making, accuracy prompt, and right-wing authoritarian attitudes on news-sharing and news discernment"
#| label: tbl-fastpaced-accuracy-authoritarian-table

table_note_fastpaced_accuracy_model <- "Note: 95% percentile confidence intervals from 5000 cluster bootstrap resamples stratified by country. All models include fixed-effects (FE). Models predicting news-sharing include headline FE and country FE, models predicting discernment include country FE."


lm_fastpaced_accuracy_authoritarian <- data_nested %>%
  select(
    data_type, outcome,
    lm_fastpaced_accuracy_authoritarian_full
  ) %>%
    # take only the estimate of the pca authoritarian model
    mutate(lm_fastpaced_accuracy_authoritarian_full = map(
      .x = lm_fastpaced_accuracy_authoritarian_full,
      .f = ~ .x[[1]]
    )) %>% 
  left_join(., 
            read_csv("data/bootstrapped_cis/cis_fastpaced_accuracy_authoritarian.csv") %>%
  filter(ci_level == 95) %>%
  filter(model_specification == "full") %>%
  filter(authoritarian_specification == "authoritarian_pca") %>% 
  nest(data = c(-data_type, -outcome, -model_specification)) %>%
  mutate(cis = map(
    data,
    ~ tibble(
      variable = paste0(.x %>% select(term) %>% pull()),
      cis = paste0(
        "[",
        sprintf("%.2f", .x %>% pull(.lower)),
        "; ",
        sprintf("%.2f", .x %>% pull(.upper)),
        "]"
      )
    ) %>% deframe()
  ))
  )


# create regression table
cm <- c(
  "above_50" = "> 50 Years (0/1)",
  "accuracy_nudge1" = "Accuracy Prime (0/1)",
  "fastpaced_nudge1" = "Fast-Paced (0/1)", 
  "authoritarian_pca1" = "Right-Wing Authoritarian (0/1)",
  "authoritarian_pca1:fastpaced_nudge1" = "Right-Wing Authoritarian x Fast-Paced",
  "authoritarian_pca1:accuracy_nudge1" = "Right-Wing Authoritarian x Accuracy Prime", 
  "fastpaced_nudge1:accuracy_nudge1" = "Fast-Paced x Accuracy Prime", 
  "authoritarian_pca1:fastpaced_nudge1:accuracy_nudge1" = "RWA x Fast-Paced x Accuracy Prime", 
  "covid_infection" = "COVID-19 Infected (0/1)",
  "covid_vaccination" = "COVID-19 Vaccinated (0/1)",
  "diaspora" = "Diaspora (0/1)",
  "female" = "Female (0/1)",
  "political_news_std" = "Political Media Consumption (Std.)",
  "religious" = "Religious (0/1)",
  "response_week_incidence" = "Incidence Rate", 
  "rural" = "Rural (0/1)",
  "support_government_std" = "Government Support (Std.)",
  "university_education" = "University Education (0/1)",
  "sequence_index" = "Sequence News Item",
  "(Intercept)" = "Intercept"
)



# report only basic goodness-of-fit statistics
round_function <- function(x) format(round(x, 3))
gm <- list(
  list("raw" = "r.squared", "clean" = "R$^2$", "fmt" = round_function),
  list("raw" = "nobs", "clean" = "Num.Obs.", "fmt" = round_function)
)


names(lm_fastpaced_accuracy_authoritarian$lm_fastpaced_accuracy_authoritarian_full) <-
  case_when(
    lm_fastpaced_accuracy_authoritarian$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced_accuracy_authoritarian$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced_accuracy_authoritarian$data_type == "true_news_item_level" ~ "True News"
  )

names(lm_fastpaced_accuracy_authoritarian$cis) <-
  case_when(
    lm_fastpaced_accuracy_authoritarian$outcome == "news_distinguish" ~ "Discernment",
    lm_fastpaced_accuracy_authoritarian$data_type == "fake_news_item_level" ~ "Fake News",
    lm_fastpaced_accuracy_authoritarian$data_type == "true_news_item_level" ~ "True News"
  )


# regression table
modelsummary(
  models = lm_fastpaced_accuracy_authoritarian$lm_fastpaced_accuracy_authoritarian_full,
  vcov = lm_fastpaced_accuracy_authoritarian$cis,
  fmt = 2,
  coef_map = cm,
  gof_map = gm,
  escape = FALSE,
  output = "kableExtra"
) %>%
  # column labels upper dimension: news item vs. respondent level
  add_header_above(c(
    " " = 1,
    "News Item Level" = 2,
    "Respondent Level" = 1
  )) %>%
  # footnote
  add_footnote(table_note_fastpaced_accuracy_model,
    notation = "none",
    threeparttable = TRUE
  ) %>%
  kableExtra::kable_styling(
    font_size = 11,
    bootstrap_options = c("hover", "striped")
  )
```




# Session Info

```{r session-info}

xfun::session_info()


```


